Apple interview question

Given string, return it without whitespaces. Follow-up: Do it in-place.