Use StringBuilder to reverse a string : StringBuilder : String C# Examples


C# Examples » String » StringBuilder »

 

Use StringBuilder to reverse a string









    
using  System;
using  System.Text;

class  MainClass
{
        public  static  void  Main()
        {
                string  str  =  "www.navioo.com";
                
                StringBuilder  revStr  =  new  StringBuilder();

                for  (int  count  =  str.Length  -  1;  count  >  -1;  count--)
                {
                        revStr.Append(str[count]);
                }
                
                Console.WriteLine(revStr.ToString());
        }
}
    
   
  
   



Output

moc.s2avaj.www


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo String
» StringBuilder