```crystal str = "this is text with too many spaces in it" str.gsub(/\s+/, " ") ```