h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Reverse string using C#.Net

Here i will give method for displaying reverse of string value using C#.net
ReverseValue is a method for display reverse of string.

public static string ReverseString(string str)
        {
            int length =str.Length -1;
            while (length >-1)
            {
                stringresult = stringresult + str[length];
                length--;
            }
            return stringresult;
        }
Call method : 
  string str = DerivedClass.ReverseString("LAKSHMI");
    MessageBox.Show(str.ToString());

No comments:

Post a Comment