Index of element in the same array

I want to get the index of a string in array of strings. I want to use this index later on with the same array of strings to check if condition. I used array_of_string(index_of_array_of_string) but I got error of index range although I am sure that the index is in the bound of indexes of the array

which statement was used to calculate the index?

Array.IndexOf(Roulage, “kg”)
Roulage is array of string

looks good
now next recommendation is to debug the flow and watching the variables and its value

It gives me the index … but when I use it inside the same array to get another variable ( using this index+1 for example) it gives me an error

keep in mind the array indexes are 0 based - 0 first element
do you know the no of elements from array, the index which is used?

I think that the problem I can’t use the index of array in the same array but i don’t know how to resolve it