there are lots of scripts out there to trim a string in javascript, but none how to Left Trim String.
This is what I use to trim:
String.prototype.trim = function() {
return this.replace(/^s+|s+$/g,"");
}
But I would like to change this a little and create a new function called leftTrim that only removes the leading space. My regex is pretty limited, so any help is much appreciated.
Cheers
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…