Accenture interview question

Write a code to check if a string is a palindrome.