Dart ダブルクォーテーションで複数行の文字列を使用する

環境
OS windows11 Pro 64bit
Dart 2.18.4

使用例
ダブルクォーテーションを使用して複数行のテキストが利用できます。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
void main() {
String strA = """study
skill""";
print(strA);
}
void main() { String strA = """study skill"""; print(strA); }
void main() {
  
  String strA = """study

  skill""";

  print(strA);
}

実行結果

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
study
skill
study skill
study

  skill

 

Dart

Posted by arkgame