Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Reverse a string using Static class definition in C#

The class must be defined 'Static' before using this code.

Include:
using System.Linq;


using System;
using System.Text;
using System.Linq;


namespace forgetCode
{
   static class Program
    {
       public static void Main(string[] args)
       {
           Console.WriteLine("Enter the string to reverse :");
           string name = Console.ReadLine();

           Console.WriteLine(name.Reverse());


       }        
            public static string Reverse(this string input)
            {
                return new string(input.ToCharArray().Reverse().ToArray());
            }
        
    }
}


Output:

Enter the string to reverse :
forget code

edoc tegrof