Pergunta de entrevista da empresa General Motors (GM)

How would you create a function that checks if a string is a palindrome?