1.//将字符串\”abcdefg\”按照”gfedcba“输出
static void Main(string[] args)
{
string str = \”abcdefg\”;
char[] ch = str.ToCharArray();
for (int i = 0; i < ch.Length / 2; i++)
{
char temp = ch[i];
ch[i] = ch[ch.Length – 1 – i];
ch[ch.Length – 1 – i] = temp;
}
str = new string(ch);
Console.WriteLine(str);
Console.ReadLine();
}