stefan1919

ReverseString

Sep 26th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.67 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication7
  8. {
  9.     class Program
  10.     {
  11.  
  12.         static void Main(string[] args)
  13.         {
  14.             string input = Console.ReadLine();
  15.             Console.WriteLine(ReverseString(input));
  16.         }
  17.        static string ReverseString(string someString)
  18.         {
  19.             StringBuilder reverse = new StringBuilder();
  20.             for (int i = someString.Length - 1; i >= 0; i--)
  21.             {
  22.                 reverse.Append(someString[i]);
  23.             }
  24.             return reverse.ToString();
  25.         }
  26.        
  27.    
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment