how do you find a particular value from a string in ASP?
dim temp="alpha,bravo,charlie"
how 开发者_运维百科do i find if 'alpha' exists in temp?
Thank You
You can use the function instr
to check for the string.
For more instructions follow this link:
http://www.w3schools.com/Vbscript/func_instr.asp
Instr is good for quick solutions, if your strins is BIG or you have to use thisoften you are better off met converting the string to an array an dthen use filter to find teh value
so
dim temp, aTemp
temp="alpha,bravo,charlie"
aTemp = split(temp,",")
aFound = Filter(aTemp , "alpha") ' aFound (0) contains "alpha" or is an empty array if not found.
Grtz
精彩评论