Reverse string in C#

Solution 1:

// Include namespace system
using System;
using System.Collections.Generic;

public class GFG
{
  // Function to return the union of two arrays
   string dummSytring= "ReverseMe";
   Console.WriteLine(dummSytring);

   char[] stringArr = dummSytring.ToCharArray();
   Array.Reverse(stringArr);

   Console.WriteLine("Reverse String: "+ new string(stringArr) );

   Console.ReadKey();
}

Comments

Popular posts from this blog

Input = INDIA, count each char in input string