如何替换url中的(/)斜杠


How to replace the (/) slash in the url?

我想更改URL样式。example.com/abc/def到example.com->abc->def

var url = http://www.example.com/url/item/
var result = url.split('/').join('->');
window.replace(result);