c# code to reverse string e.g: " This is my book" should be reversed as "book my is this".
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.
Veekkas YerhpudePosted Jun 26, 2014, 7:17 AM
Veekkas YerhpudePosted Jun 26, 2014, 7:16 AM
Princy GuptaPosted Jun 26, 2014, 7:11 AM
public static string ReverseWords(string sentence)
{
string[] words = sentence.Split(' ');
Array.Reverse(words);
return string.Join(" ", words);
}
KalaiPosted Jun 26, 2014, 7:06 AM
Refer this http://www.dotnetperls.com/reverse-words