How do you remove extra spaces from a string in Ruby?
How do you remove extra spaces from a string in Ruby? If you want to remove only leading and trailing whitespace (like PHP’s trim) you can use . strip , but if you want to remove all whitespace, you can use . gsub(/\s+/, “”) instead . How do you get rid of spaces in a […]