Reverse a string
// Online C# Editor for free // Write, Edit and Run your C# code using C# Online Compiler using System; public class HelloWorld { public static void Main(string[] args) { var x= "hi sahir"; string reverse =""; for (int i= x.Length-1;i>=0;i--) { reverse = reverse + x[i]; } Console.WriteLine(reverse); Console.ReadLine(); } } public static string Reverse1(string Input) { // Converting string to character array char[] charArray = Input.ToCharArray(); // Declaring an empty string string reversedString = ""; // Iterating the each character from right to left for (int i = charArray.Length - 1; i >=0; i--) { // Append each character to the reversedstring. reversedString = reversedString+ charArray[i]; } // Return the reversed string. return reversedString; ...

