Pergunta de entrevista da empresa Vodafone

They asked me a coding question. How to check if a string is a palindrome.