Removes trailing whitespace or specified characters from string.
string
5.6.0
[[trim]],[[trimStart]]
trimEnd(' abc ')// => ' abc'trimEnd('-_-abc-_-', '_-')// => '-_-abc' Copy
trimEnd(' abc ')// => ' abc'trimEnd('-_-abc-_-', '_-')// => '-_-abc'
The string to trim.
The characters to trim.
Optional
Returns the trimmed string.
Removes trailing whitespace or specified characters from
string
.Since
5.6.0
See
[[trim]],[[trimStart]]
Example