SyntaxFix
Write A Post
Hire A Developer
Questions
Without using regex (though I would only do this if the search string is user input):
var str = 'Hello/ world/ this has two slashes!'; alert(str.split('/').join(',')); // alerts 'Hello, world, this has two slashes!'