Friday, 26 August 2011

Palindrome String Logic

string str = "INDIA", rev_str = "";
for (int i = str.Length - 1; i >= 0; i--)
      rev_str += str.Substring(i, 1).ToString();


string str = "malayalam", rev_str = "";
for (int i = str.Length - 1; i >= 0; i--)
    rev_str += str.Substring(i, 1).ToString();
if (str == rev_str)
    lblmessgae.Text = "Given string is Palendrome string";//print statement
else
    lblmessgae.Text = "Given string is not Palendrome string";//print statement

Tag: Palindrome String, Palindrome String in c, Palindrome String in c++, Palindrome String Logic, Palindrome String program in c, Palindrome String program in c#, Palindrome String program in c++

No comments:

Post a Comment

Parsing JSON w/ @ symbol in it

To read the json response like bellow @ concatenated with attribute                             '{ "@id": 1001, "@name&q...