Reverse a
string in C#
In this article we will see how to Reverse a string in C#
public static void
Reverse() {
Console.Write("Enter the string : "); string
inputString = Console.ReadLine(); string
result = ""; for (int i =
inputString.Length - 1; i >= 0; i--)
result += inputString[i];
Console.WriteLine(result); } |
Output
EmoticonEmoticon