Pages

Wednesday, December 31, 2008

Reverse String in C#

Normally we write FOR loop logic to reverse a string, may be because we dont explore the in-built functions of the language.

char [] strArray = TextBox1.Text.ToCharArray();
Array.Reverse( strArray );
string ReverseString = new string( strArray );
Label1.Text = ReverseString;

No comments: