I want to reverse the string, is there any method in .Net 2010 do that? with C#lan
forexample:
string s2= "abcdefg";
but I want that "gfedcba" is written.
Console.WriteLine(s2); // gfedcba
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jul 27, 2011, 9:49 AM
Hirendra SisodiyaPosted Jul 27, 2011, 9:24 AM
VulpesPosted Jul 27, 2011, 5:32 AM
Suthish NairPosted Jul 27, 2011, 1:47 AM
Vulpes,
VulpesPosted Jul 26, 2011, 4:09 PM
However, methods like this which manipulate memory directly using pointers are best avoided in normal application code - stick to the 'safe' methods.
Suthish NairPosted Jul 26, 2011, 4:25 AM
Amit ChoudharyPosted Jul 26, 2011, 2:47 AM
Using System.Linq;
String str = "aabcadfdsf";
Console.WriteLine(str.Reverse().ToArray<Char>());
Hope this was helpful.
Thanks.
Jiteendra SampathiraoPosted Jul 26, 2011, 2:43 AM
string str= "jiteendra";
char[] reverse = str.ToCharArray();
Array.Reverse(reverse );
string StringReverseOrder = new string(reverse);
i hope it help you.........