I have a problem to find a regular expression to replace all spaces in given string:
var test = '1 2 3 4';
alert(test.replace(/\s/, ''));
The first space is replaced correctly but I want to get the string without any spaces. In the example above I'm expecting "1234".