Version: v0.7.0 - Beta.  We welcome contributors & feedback.

String.trim

trim($trimChars = '') -> string

Description

Remove all whitespace characters (including newlines) from the beginning and end of the string.

$trimChars can be a string of characters to trim in addition to whitespace.

'   abc   '.trim()      //= 'abc'
'+- abc -+'.trim('-+')  //= 'abc'

See Also