Learn
is_palindrome()
Instructions
1.
Define a function is_palindrome()
that takes:
- An
std::string
parametertext
.
The function should return:
true
iftext
is a palindrome.false
iftext
is not a palindrome.
(A palindrome is any text that has the same characters backwards as it does forwards. For example, “hannah” and “racecar” are palindromes, while “menu” and “aardvark” are not.)
We will not test for edge cases such as capitalization or spaces.
Take this course for free
By signing up for Codecademy, you agree to Codecademy's Terms of Service & Privacy Policy.