Squeeze Out The Extra Space
ruby
Written April 30, 2015
Remove all the excess spaces from a string using the squeeze method:
> "this is a string".squeeze(' ')
=> "this is a string"
Remove all the excess spaces from a string using the squeeze method:
> "this is a string".squeeze(' ')
=> "this is a string"