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


Top 5 Contributors of the Month
satyapriyanayak
Subhransu Sekhar Jena
abhays
SP
DotnetUser

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://mgu.ac.in/  
 

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

String Value="Welcome To .NET";
StringReverse(Value);

Code:

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:

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