Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool IsPalindrome(string word)
- {
- int i = 0;
- int j = word.Length - 1;
- while (true)
- {
- if (i > j)
- {
- return true;
- }
- char a = word[i];
- char b = word[j];
- if (char.ToLower(a) != char.ToLower(b))
- {
- return false;
- }
- i++;
- j--;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement