public bool isPalindrome(String str)
{
if (String.IsNullOrEmpty(str))
return false;
int length = str.Length;
str = str.ToLower();
for (int i = 0; i < (length / 2); i++)
{
if (str[i] != str[length - 1 - i])
return false;
}
return true;
}
This blog is for .NET and related web technology, where you will find some really good and time saving answers which can help you to make your fundaas clear.
Showing posts with label Palindrome. Show all posts
Showing posts with label Palindrome. Show all posts
Monday, June 4, 2012
How to check string is palindrome or not in .NET
Subscribe to:
Comments (Atom)
