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

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

Home >> Code Snippets >> Regular Expressions >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

String Reverse in C#

Posted By:Athira Sreejith       Posted Date: December 31, 2008    Points: 10    Category: Regular Expressions    URL: http://www.dotnetspark.com  

Below code show how to get reverse of given string. For testing purposr your given string is as follows

String Value="Welcome To .NET";


private string StringReverse(string Value)
char[] sChar = Value.ToCharArray();
int Length = Value.Length-1;

for (int K=0;x {
sChar[K] ^= sChar[Length];
sChar[Length] ^=sChar[k];
sChar[K] ^= sChars[Length];

return new string(sChar);


Further Readings:


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