string str = "sdvsd fgfgd dfhsjhf"; //str=Console.ReadLine(); char[] a; a = strError.ToCharArray(); Array.Reverse(a); string s = new string(a); Console.WriteLine(s);
// To do the Job in One line code. Console.ReadLine().Reverse().ToList().ForEach(ch => Console.Write(ch)); //Or // Read the userinput first and then apply the rule to reverse it. var input = Console.ReadLine(); Console.WriteLine(string.Join(string.Empty, input.Reverse().ToArray()));
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)