How would I remove blank characters from a string in JavaScript?
A trim is very easy, but I don\'t know how to remove them from inside the string. For example:<
You can use a regex, like this to replace all whitespace:
var oldString = "222 334"; var newString = oldString.replace(/\s+/g,"");
Or for literally just spaces:
var newString = oldString.replace(/ /g,"");