I would like to remove white spaces and hyphens from a given string.
var string = "john-doe alejnadro";
var new_string = string.replace(/-\s/g,"")
Doesn't work, but this next line works for me:
var new_string = string.replace(/-/g,"").replace(/ /g, "")
How do I do it in one go ?