Advertisement
Guest User

Strings and text processing 1

a guest
Jan 24th, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 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 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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement