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