I have got below te开发者_运维问答xt as string
test = "<span class='convert'>USD 30</span>"
I need to write a function in VBSCript which will take above string as input and will return USD 30 as output.
Please suggest
output = Replace (Replace(test , "<span class='convert'>",""),"</span>","")
If your input text is more complicated than the example you've given, I would recommend using an XML library such as MSXML to parse the text. Otherwise, you can use a regex
Const test = "<span class='convert'>USD 30</span>"
dim regex: set regex = new RegExp
regex.pattern = ">([^<]*)"
dim matches: set matches = regex.execute(test)
dim output: output = Empty
if matches.Count <> 0 then
output = matches(0).submatches(0)
end if
Response.Write output
精彩评论