strip both sides : Strip « String « Ruby






strip both sides

fear = "             F                  "
puts fear.strip 

 








Related examples in the same category

1.Strip from both side in place
2.Strip the tab and new line characters
3.strip removes other kinds of whitespace, too:
4.Managing Whitespace and new line character