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
If you don't mind the extra object being created, either of these work:
"#{s}".strip s.to_s.strip
Without extra object:
s && s.strip s.strip if s