JavaScript remplace l'espace par moins

// replaces space with '-'
str = str.replace(/ /g, "-");
// or
str = str.split(' ').join('-');
VasteMonde