String interpolation allows you to embed expressions or variables within a string using ${}.
String name ="Alice";int age =30;String greeting ="Hello, ${name}! You are ${age} years old.";print(greeting);// "Hello, Alice! You are 30 years old."
3. String Length:
You can get the length of a string using the length property.
4. Substring:
You can extract a portion of a string using the substring method.
5. Searching:
You can search for substrings within a string using contains, startsWith, and endsWith methods.
6. Splitting:
You can split a string into a list of substrings using the split method.
7. Trimming:
You can remove leading and trailing whitespace characters from a string using trim, trimLeft, and trimRight methods.
8. Converting to Upper/Lower Case:
You can convert a string to uppercase or lowercase using toUpperCase and toLowerCase methods.
These are some of the common string operations in Dart. String manipulation is an important part of many Dart applications, especially when dealing with user input and text processing.