Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isCaseInsensitivePalindrome(inputString)
- string = inputString.downcase
- x = 0
- string_1 = ""
- string_2 = ""
- while (x < string.length)
- string_1 = string_1 + string[x]
- x = x + 1
- end
- x = string.length - 1
- while (x >= 0)
- string_2 = string_2 + string[x]
- x = x - 1
- end
- if string_1 == string_2 then
- return true
- else
- return false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment