.strip()

Description

strip removes whitespace from both ends of a string.

Parameters

strip takes no parameters.

Usage On Strings

str = "  hello world  "
log str.strip()
// "hello world"

str = "\n\tspaces and tabs\t\n"
log str.strip()
// "spaces and tabs"

str = "no spaces"
log str.strip()
// "no spaces"

Last updated

Was this helpful?