trimStart

An improved javascript string method: It not only removes leading whitespace from a string but also eliminates any specified characters.

let myString = "%20jubbtech.com";

myString.trimStart('%20'); // jubbtech.com

It receives the characters to trim. Default is a single space.

let myString = " jubbtech.com";

myString.trimStart(); // jubbtech.com

Last updated