regex - Replace part of URL with JavaScript -
I want to change the part of the URL with javascript but stupid Rijks is giving me a headache. I want to switch from:
http://website.com/test.html/post/something-else/ do this For:
http://website.com/post/something-else/ Any ideas? Thanks!
Use the Change () function
var url = ' Http://website.com/test.html/post/something-else/ 'url = url.replace (' / test.html ',' ') console.log (url) // "http: // Website Com / Post / something-else / "
Comments
Post a Comment