Dart编程实例 - 字符串

本文为大家分享 Dart编程实例 - 字符串 的具体示例代码,提供大家参考,具体内容如下:

void main() {
   String str1 = 'this is a single line string';
   String str2 = "this is a single line string";
   String str3 = '''this is a multiline line string''';
   String str4 = """this is a multiline line string""";
   print(str1);
   print(str2);
   print(str3);
   print(str4);
}

本文为大家分享 Dart编程实例 - 字符串插值 的具体示例代码,提供大家参考,具体内容如下:void main() { int n=1+1; String str1 = "The sum of 1 and ...