Apple interview question

Remove spaces from a string.