SHARE
TWEET

Strings and text processing 1

a guest Jan 24th, 2013 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Reversed
  8. {
  9.     class Reversed
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             //takes input
  14.             Console.WriteLine("Enter a string:");
  15.             string input = Console.ReadLine();
  16.  
  17.             //converts the input to char array
  18.             char[] inputArr = input.ToCharArray();
  19.  
  20.             //reverses the char array
  21.             Array.Reverse(inputArr);
  22.             string input2 = new string(inputArr);
  23.  
  24.             Console.WriteLine(input2);
  25.         }
  26.     }
  27. }
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