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

String.trimRight

trimRight($trimChars = '') -> string

Description

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

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

'  abc  '.trimRight()     //= '  abc'
'23%    '.trimRight('%')  //= '23'

See Also