September 2019
Beginner
512 pages
12h 52m
English
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.
Read now
Unlock full access