String Interpolation With the Dollar Sign
Embed values and expressions inside strings.
What Interpolation Means
Interpolation lets you drop a value straight into a string, so Dart builds the final text for you instead of gluing pieces by hand.
The Dollar Sign Trigger
Inside a string, the dollar sign tells Dart the next word is a variable to insert. It is the heart of interpolation.
var name = 'Ada';
var hi = 'Hi, $name!';All lessons in this course
- String Literals and Quotes
- String Interpolation With the Dollar Sign
- Multi-line and Raw Strings
- Everyday String Methods