Monday, February 8, 2010

Reverse a string.

string str = "This is the string which we have to revert";
char[] step1 = str.ToCharArray();
Array.Reverse(step1);
Console.WriteLine("Original string:" + str);
Console.WriteLine("Reverse of a string:" + new string(step1));

No comments: