trimEnd
An improved javascript string method: It not only removes tailing whitespace from a string but also eliminates any specified characters.
let myString = "http://jubbtech.com%20";
myString.trimEnd('%20'); // http://jubbtech.com
It receives the characters to trim. Default is a single space.
let myString = "http://jubbtech.com ";
myString.trimStart(); // http://jubbtech.com
Last updated