String interpolation

Dart has a useful syntax to interpolate the value of Dart expressions within strings: ${}, which works as follows:

main() {
String someString = "This is a String";

print
("The string value is: $someString ");
// prints The string value is: This is a String

print
("The length of the string is: ${someString.length} ");
// prints The length of the string is: 16
}

As you may have noticed, when we are inserting just a variable and not an expression value into the string, we can omit the braces and just add $identifier directly.

Dart also has the runes concept to represent UTF-32 bits. For more details, check out the Dart language tour: https://dart.dev/guides/language/language-tour.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.27.202