Adding string in existing url using VBScript
I am using VBScript for programming
I have three vairables and there value is coming through vbscript program.
publicationPath = "/test/english"
publicationUrl = "/101/english"
publishedPath = "/test/english/about/india/delhi.aspx"
Now if you see the publ开发者_如何学运维icationPath and publishedPath's "/test/english" is same. Now I want that this will be replaced with the publicationUrl value, I mean the final url will be as given below.
pagePublishPath = /101/english/about/india/delhi.aspx"
Please suggest the solution using VBScript
Thanks.
To replace a substring with another substring within a string, use the Replace
function:
pagePublishPath = Replace(publishedPath, publicationPath, publicationUrl, 1, 1, vbTextCompare)
精彩评论