我正在尝试反转数组中的字符串元素,但我得到了准确的字符串顺序。这是代码
public static void ReverseArrayElements()
{
Console.WriteLine("This will init array elements and reverse its elements");
string[] elements = { "one, two, three" };
for (int i = 0; i < elements.Length; i++)
{
Console.WriteLine("Array elements before reversing: {0}", elements[i]);
}
Console.WriteLine("\n");
Array.Reverse(elements);
for (int i = 0; i < elements.Length; i++)
{
Console.WriteLine("Array elements after reversing: {0}", elements[i]);
}
Console.ReadLine();
}
结果是一、二、三,再排序后是一、二、三。
我在这里做错了什么?