1const removeSpaces = str => str.replace(/\s/g, '');
2
3// Example
4removeSpaces('hel lo wor ld'); // 'helloworld'
1var puzzle1=myTrim($("#puzzleinput").val());
2 function myTrim(x) {
3 return x.replace(/^\s+|\s+$/gm,'');
4 }