instance method String#strip

View source on GitHub →

String#strip() → String

Strips all leading and trailing whitespace from a string.

Example
'    hello world!    '.strip();
// -> 'hello world!'