SHARE
TWEET

Reverse string and print

hristo_bratanov Jan 27th, 2013 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. class ReverseString
  5. {
  6.     static void Main()
  7.     {
  8.         Console.Write("string = ");
  9.         string input = Console.ReadLine();
  10.         List<char> inputToList = new List<char>();
  11.         for (int i = 0; i < input.Length; i++)
  12.         {
  13.             inputToList.Add(input[i]);
  14.         }
  15.         inputToList.Reverse();
  16.         Console.WriteLine(String.Concat(inputToList));
  17.     }
  18.  
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top