jsToolboxMJK.funcs.trimRight() - mkloubert/jsToolbox GitHub Wiki

jsToolboxMJK.funcs.trimRight(obj) method

Removes all whitespaces of the string representation of an object from the end.

Syntax

$jsTB.funcs.trimRight(obj);

Parameters

Name Type Description
obj Object The object to convert.

Result

The trimmed string of the object.

Examples

var s1 = ' 5979  ';
var s2 = null;

// ' 5979'
var res1 = $jsTB.funcs.trimRight(s1);
// ''
var res2 = $jsTB.funcs.trimRight(s2);