javascript remove white space at beginning string code example
Example: how to remove whitespace only from first position of string js
function ltrim(str) {
if(!str) return str;
return str.replace(/^\s+/g, '');
}
function ltrim(str) {
if(!str) return str;
return str.replace(/^\s+/g, '');
}