js obtient un mot avant le point d'interrogation

var str = "/root/Users?SkillId=201;"

str = str.replace(/\?.*$/g,"");
console.log(str);
Borma