General Motors (GM) interview question

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