arr = "-2=A;0=20;3=5;b=2.4;xy=abc;-de=-100.5;6z=a;7.5=ABC;z=abc;" ' test array
val = "abc" ' search for value
allIdcs = "True" ' search through ALL Indices (True) or only 1st matching index (False) ?
valCaseInsens = "" ' should searched Value be case-INsensitive (True) or not (False) ?
'bTrim = "" ' you could also search for values (which are L/R space-trimmed) OR..
'bIsInVale = "" ' ... does array value CONTAIN the searched val (resp.)
If valCaseInsens Then
arr = Text.ConvertToLowerCase(arr)
val = Text.ConvertToLowerCase(val)
EndIf
For n = 1 To nArr
If arr[idcs[n]] = val Then
If allIdcs Then
len = len + 1
res[len] = idcs[n]
Else
res = idcs[n]
n = nArr ' ExitFor
EndIf
EndIf
EndFor
TextWindow.WriteLine(arr)
TextWindow.WriteLine("")
TextWindow.WriteLine("Value '"+ val +"' found in index(indices):")
TextWindow.WriteLine(res)
TextWindow.WriteLine("")