TheChaseMan's Frenetic SoapBox
Always looking for better ways to do things...
How do you reverse a string? This is not a problem in VB.NET, but in C#...it also isn't a problem. :)
posted on Saturday, February 07, 2004 12:55 PM
If you are asked to solve this without using Array.Reverse() and still use the least looping then the solution would be: char[] chars = ("Hello World").ToCharArray(); int count = c.Length - 1; for (int i = 0; i <= count / 2; i++) { char tmp = c[i]; c[i] = c[count - i]; c[count - i] = tmp; } return new String(chars);