How to find a specific value from a string in ASP

How do you find a specific value from a string in ASP?

dim temp="alpha,bravo,charlie" 

How to find if alpha function exists in temp?

thanks

+4
source share
2 answers

You can use the instr function to check the string.

For further instructions, follow this link:

http://www.w3schools.com/Vbscript/func_instr.asp

+5
source

Instr is good for quick fixes, if your strings are BIG or you need to use it often, you better convert the string to an array and then use a filter to find the 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

+2
source

Source: https://habr.com/ru/post/1339226/


All Articles