string test= "abcdefgh";
1. 字符串倒序读取
string result = string.Empty;
for (int i = test.Length - 1; i >= 0; i--)
{
result += test[i];
}
2. 二分法转换
string result = string.Empty;
char[] arrTest = test.ToCharArray();
for (int i = 0; i < arrTest .Length / 2; i++)
{
char temp = arrTest [i];
arrTest [i] = arrTest [arrTest.Length - i - 1];
arrTest [arrTest .Length - i - 1] = temp;
}
result = new string(arrTest);