You can use the plus (+
) operator to concatenate strings:
'Dart ' + 'is ' + 'fun!'; // 'Dart is fun!'
You can also use adjacent string literals for concatenation:
'Dart ' 'is ' 'fun!'; // 'Dart is fun!'
You can use ${}
to interpolate the value of Dart expressions within strings. The curly braces can be omitted when evaluating identifiers:
var text = 'dartlang';
'$text has ${text.length} letters'; // 'dartlang has 8 letters'