General Motors (GM) Interview Question

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