Trimming Blanks from the Ends of a String


(For all intents and purposes, this project is dead, but let us just call it "Deferred Indefinitely". Shall we?)

Problem

You want to strip the leading and trailing whitespace from a string.

Solution

Use String#strip:

% string = "   this is a string   "
% string.strip
"this is a string"

Discussion

TODO: DISCUSSION

Contrast

TODO: LIST_OF_OTHER_PROGRAMMING_LANG_METHODS

Related

TODO: LIST_OF_RELATED_ITEMS

Status: In Progress