Regular Expressions 101

Community Library Entry

106

Regular Expression
ECMAScript (JavaScript)

/
^[ \t]+|[ \t]+$
/
gm

Description

Trim leading and trailing whitespace from a string.

Submitted by fp - 11 years ago (Last modified 2 months ago)