.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> Collections >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

reverse a string in c#

Posted By:Rajshree       Posted Date: September 14, 2010    Points: 10    Category: Collections    URL: http://www.dotnetspark.com  

Function to Reverse the given string
 

Function to reverse a string given below:

static public string Reverse( string s ) 
{
    char[] charArray = s.ToCharArray();//array declaration
    Array.Reverse( charArray );reversing string and Array is Class or pre defined class
    return new string( charArray );
}

this allow user to reverse a string or a entered string

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend