using System; static class StringHelper { /// <summary> /// Receives string and returns the string with its letters reversed. /// </summary> public static string ReverseString(string s) { char[] arr = s.ToCharArray(); Array.Reverse(arr); return new string(arr); } } class Program { static void Main() { Console.WriteLine(StringHelper.ReverseString("framework")); Console.WriteLine(StringHelper.ReverseString("samuel")); Console.WriteLine(StringHelper.ReverseString("example string")); } } === Output of the program === krowemarf leumas gnirts elpmaxe
0 comments:
Post a Comment