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


Top 5 Contributors of the Month
abhays
Clintonzz
mattyclown
cathyhill345
arronlee

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

 Subscribe to Code Snippets

Using LINQ to Reverse of a String

Posted By:Ravi Ranjan Kumar       Posted Date: July 24, 2011    Points: 40    Category: LINQ    URL: http://raviranjankr.wordpress.com/  

This Code Snippets enable you to learn how to reverse String with using LINQ
 

You can use simple use given method to get string in reverse order
public static string ReverseString(string str)
      {

                      return new string(Enumerable.Range(1, str.Length).Select(i => str[str.Length - i]).ToArray());

        }
How to use 
string str = ReverseString("HelloWorld");
after executing program

str will hold dlroWolleH

     

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