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'