JS Streifen Sie mehrere Räume aus
string = string.replace(/\s\s+/g, ' ');
Modern Mouse
string = string.replace(/\s\s+/g, ' ');
var name = "Code padding";
//remove multiple space to single
name = name.replace(/ +/g, ' '); // Code padding