Reverse String - CSharp System

CSharp examples for System:String SubString

Description

Reverse String

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from   www  .j  av  a2s . co m

public class Main{
        public static string ReverseString(string input)
        {
            string result = "";

            for (int i = 0; i < input.Length; i++)
            {
                result = input.Substring(i, 1) + result;
            }

            return result;
        }
}

Related Tutorials