How to do Trim operation to remove space character in a text field in JavaScript?
views:
790answers:
2
+2
A:
A total dupe of this question:
http://stackoverflow.com/questions/196925/what-is-the-best-way-to-trim-in-javascript
Unless you didn't actually mean trim of course and in fact wanted all the spaces replaced ? In which case you just want:
var myString = "foo bar ddd";
myString = myString.replace(/ /g, "");
andynormancx
2009-02-02 09:09:15