首页 > 建站教程 > dart >  Dart编程实例 - dart字符串插值正文

Dart编程实例 - dart字符串插值

Dart编程实例 - dart字符串插值

void main() {

   int n=1+1;

   String str1 = "The sum of 1 and 1 is ${n}";

   print(str1);

   String str2 = "The sum of 2 and 2 is ${2+2}";

   print(str2);

}