Barclays interview question

a code to write to check if a string is palindrome,