Friday, April 10, 2009

How to reverse string

   26             string originalString = "123456789";

   27             char[] buffer = originalString.ToCharArray();

   28             Array.Reverse(buffer);

   29             string reversedString = new String(buffer);

   30 

   31             Console.WriteLine();

   32             Console.WriteLine("original string: " + originalString);

   33             Console.WriteLine("reversed string: " + reversedString);

 

image

1 comment:

Anonymous said...

http://msdn.microsoft.com/en-us/magazine/cc163688.aspx