String manipulation puzzles