strings ="Shdfidshidfid"; intChangdu = s.length;//returns the length of the string, attributes (with a small wrench) stringA = S.trim ();//remove space before and after stringb = S.trimend ();//Remove the front space stringc = S.trimstart ();//space after removal stringD = S.toupper ();//Convert to uppercase stringE = S.tolower ();//Convert to lowercaseConsole.WriteLine ("Length:"+Changdu); Console.WriteLine ("Original string:"+s); Console.WriteLine ("go to space:"+a); Console.WriteLine ("Uppercase:"+d); Console.WriteLine ("Lowercase:"+e); //It is important to intercept a string, the string is indexed, and the index starts at 0 . stringG=s.substring (3,3); stringH = s.substring (3); Console.WriteLine ("after interception"+g); Console.WriteLine ("Intercept"+h); //Find Index, intI= S.indexof ("fi");//finds the index of a character segment in a string, starting with 0 intIi= S.indexof ("fi",4); intJ= S.lastindexof ("fi");//Check it from the back and forward .//replacing Replace stringk= S. Replace ("fi","123"); Console. WriteLine ("New String"+k); //The partition needs to use a string stringSS ="A,s,d,fdf,gg,jj,ku"; string[] str = ss. Split (','); foreach(stringLinchstr) {Console.WriteLine (l);}
09.20 String class type