string str = "在校不迷茫,毕业即辉煌";
char[] chararray = new char[str.Length];
for (int i = 0; i < str.Length; i++)
{
}
for (int i = 0; i < chararray.Length; i++)
{
Console.WriteLine(chararray[i]);
}
Console.ReadKey();
StartsWith、EndsWith
string str = "Hello World";
Console.WriteLine(str.StartsWith("Hw"));
Console.WriteLine(str.EndsWith("ld"));
Console.ReadKey();
原文:http://www.cnblogs.com/songfang/p/4098097.html