javascript remove from the first instance ofwhitespace and then code example
Example: js remove space before string
var str = " Some text ";
str.trim();
// str = "Some text"
var str = " Some text ";
str.trim();
// str = "Some text"