I’m trying to split a string in classic ASP by two parameters/patterns
As an example, I’m trying to do something like
str = "1,2,3,4|5|6.7.8"
arr = Split(str, "," , "|" )
'arr = [ 1 , 2 , 3 , 4 , 5 , 6.7.8 ]
Is there a way to do that besides writing my own split function? (iterating over the entire string, comparing with patterns…)
You can replace one of the values first, then split on it. For example, replace commas with pipes, then split on pipes: