Strip from both side in place : Strip « String « Ruby






Strip from both side in place


fear = "             F             "


p fear.strip! 

 








Related examples in the same category

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