I recently had to develop a string reverse function in C# 2.0 (since LINQ wasn't an option) and came up with the following:
public string Reverse(string text)
{
char[] cArray = text.ToCharArray();
string reverse = String.Empty;
for (int i = cArray.Length - 1; i > -1; i--)
{
reverse += cArray[i];
}
return reverse;
}
Is there a better way to do this?