Strings Example Program in Dart


Example Program:

Here is the simple program for printing basic example of strings in dart.

Source Code

void main() {
   String name1='Tutor';
   print(name1);
   String name2='Joes';
   print(name2);
   print("Hi ${name1} ${name2}");
   String name="Tutor Joes ";
   print(name.substring(0,5));
   int index=name .indexOf(' ');
   print(index);
   print(name.substring(index).trim());
   print(name.toUpperCase());
   print(name.toLowerCase());
   print(name.length);
   print(name.contains('xyz'));
   name="Tutor Joes Computer Education";
   List words=name.split(' ');
   print(words);
   print(words[0]);

}
To download raw file Click Here

Output

Tutor
Joes
Hi Tutor Joes
Tutor
5
Joes
TUTOR JOES 
tutor joes 
11
false
[Tutor, Joes, Computer, Education]
Tutor


Learn All in Tamil © Designed & Developed By Tutor Joes