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

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -