Reverse string write without change word position in c#
static void Main(string[] args) {
string orgstr = "my name is sagar";
string revstr = "";
foreach(var word in orgstr.Split(' ')) {
string temp = "";
foreach(var ch in word.ToCharArray()) {
temp = ch + temp;
}
revstr = revstr + temp + " ";
}
Console.Write(revstr);
Console.ReadKey();
}