delete first whitespace js 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, '');
}