Hapus spasi dalam string js
str.replace(/\s+/g, '')
Dangerous Duck
str.replace(/\s+/g, '')
str = str.replace(/\s/g, '');
var a = b = " /var/www/site/Brand new document.docx ";
console.log( a.split(' ').join('') );
console.log( b.replace( /\s/g, '') );
var puzzle1=myTrim($("#puzzleinput").val());
function myTrim(x) {
return x.replace(/^\s+|\s+$/gm,'');
}