I have a string in Ruby on which I\'m calling the strip method to remove the leading and trailing whitespace. e.g.
s = \"12345 \" s.strip
H
You could simply do this
s.try(:strip)