Handle consecutive spaces in strings