LTrim(),RTrim(),Trim() Functions in JavaScript
JavaScript lacks the Trim() function. See below the code for trimming a string: function LTrim(ValueToTrim){ValueToTrim =ValueToTrim.toString()var WhiteSpace=new String(” “);var i=0;while(WhiteSpace.indexOf(ValueToTrim.charAt(i))>-1){ i++;}return ValueToTrim.substring(i);}function RTrim(ValueToTrim){ ValueToTrim =ValueToTrim.toString() var WhiteSpace=new String(” “); var