Wednesday 2 June 2021

Get Reverse string in C#

  public string GetReverseString(string value)  

        {    string result = "";  

            if (string.IsNullOrEmpty(value))  

                return "";  

            for (int i = value.Length - 1; i >= 0; i--)  

            {  result += value[i];  

            }  return result;  

        } 

No comments:

Post a Comment