Version: v0.6.1 - Beta.  We welcome contributors & feedback.  THanks!

String.trim

trim($trimChars = '')

Description

Remove all leading and trailing whitespace characters, including newlines.

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

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

See Also