General Motors (GM) interview question

First question was string manipulation. Easy stuff.