void main() {
var a ="Welcome in Dart String";
var c='';
var d="WELCOME";
var e="Welcome in Java Dart";
if(d=="WELCOME"){
print("Compression is True");
}
if(a.startsWith("Welcome")){
print("The given string a is start with Welcome: true");
}
if(a.endsWith("String")){
print("The given string a is end with String: true");
}
if(a.contains("Dart")){
print("The given string a is contains Dart: true");
}
if(c.isEmpty()){
print("The given string c is empty:true");
}
int len=a.length;
print("The length of string a is:${len}");
print("The upper case of string a is");
print(a.toUpperCase());
print("The lower case of string d is");
print(d.toLowerCase());
print("Repalce of Java With Google in string e is:");
e=e.replaceFirst("Java", "Google");
print(e.trim());
int pos=e.indexOf("Dart",0);
print("The index of Dart in string e is:${pos}");
print("Repalce all a from d in string a is:");
print(a.replaceAll("a", "d"));
print("The last position of E in string d is:");
print(d.lastIndexOf("E"));
}
|