int 类型 64 位,根据平台。
var y = 1.1;var exponents = 1.42e5;
var y = 1.1;var exponents = 1.42e5;
String numToStr = 1.toString();
String piAsString = 3.14159.toStringAsFixed(2);
字符串定义我们在每种语言中主要看公告时候的语义。这是可以看这种语言对字符串下了多少功夫。
var s1 = 'Single quotes work well for string literals.'; var s2 = "Double quotes work just as well.";
在 Dart 语言中可以使用双引号或者单引号都可以公告字符串,不过在单引号中使用单引号需要转义,而在双引号中使用单引号则不需要转义。
var s3 = 'It\'s easy to escape the string delimiter.';var s5 = "It's even easier to use the other delimiter.";
String s6 = 'welcome' ' to ' ' zidea zone ';
在 Dart 语言中假如字符串过长,超出屏幕宽度时候可以上面那样表达,不用 + 了,很方便。
var s7 = '''You can createmulti-line strings like this one.'''; var s8 = """This is also amulti-line string.""";