JavaScript Hapus semua spasi dari string
str = str.replace(/\s/g, '');
TC5550
str = str.replace(/\s/g, '');
var name = "codepadding code ";
// remove all white spaces single or multiple spaces
var name = name.replace(/\s/g, '');
console.log(name)
//output
//mizanurrahmanmizan
var str = " Hello World! ";
alert(str.trim());
console.log(' a b c d e f g '.replaceAll(' ',''));
//abcdefg
var string = "Javascript is fun";
var newString = string.replace(" ", "_");
console.log(newString); // Javascript_is_fun