Monday, April 20, 2009

Reversing a string

The easiest way to reverse the string is as follows:

char[] actualDataInArray = myStringData.ToCharArray();
Array.Reverse(actualDataInArray);
string reversedString = new string(actualDataInArray);

That's it.

No comments: