Reverse A String In C#.NET

  1. using System;  
  2. namespace Learn {  
  3.     class Program {  
  4.         static void Main(string[] args) {  
  5.             string Str, Revstr = "";  
  6.             int Length;  
  7.             Console.Write("Enter A String : ");  
  8.             Str = Console.ReadLine();  
  9.             Length = Str.Length - 1;  
  10.             while (Length >= 0) {  
  11.                 Revstr = Revstr + Str[Length];  
  12.                 Length--;  
  13.             }  
  14.             Console.WriteLine("Reverse String Is {0}", Revstr);  
  15.             Console.ReadLine();  
  16.         }  
  17.     }