String.prototype.trimRight() - mkloubert/jsToolbox GitHub Wiki

String.prototype.trimRight() method

Removes all whitespace at the end.

Syntax

String.prototype.trimRight();

Result

The trimmed string.

Examples

var s = '   5979  ';

// '   5979'
var res = s.trimRight();