How to squish in ruby -


i want squish in ruby. have found method in ruby on rails want use in ruby because have not use ruby on rails.

how can in ruby.

" foo   bar    \n   \t   boo".squish # => "foo bar boo" 

try following:

" foo   bar    \n   \t   boo".split.join(" ") # => "foo bar boo" 

Comments