I am practicing javascript questions. I want to split a string which have -.,. how to pass all three in split function I my first test case is passed if I used like this str.split('-') but other test case failed ?
s
entensify("May-the-force-be-with-you") should return "May the force be with you".
sentensify("The.force.is.strong.with.this.one") should return "The force is strong with this one".
sentensify("There,has,been,an,awakening") should return "There has been an awakening".
any better solution to pass all test cases
function sentensify(str) {
//console.log(str.split(/\s*(?:-;|$)\s*/).join(' '))
return str.split('-').join(' ')
}