I have a url path as shown below.
http://localhost:12534/urlpart1/urlpart2?querystring=140
So I need to replace the "urlpart2" with the "urlpart3" by using javascript or anugularjs.How can I do that.I can get the whole url by using:
var urlPath = window.location.href;
Any help would be highly appreciated.
replace('urlpart2', 'urlpart3')?urlpart2you can go with simple replace method:var newUrlPath = urlPath.replace('urlpart2', 'urlpart3'). Try it and see if it's what you need.