I'm trying to search for the array position of a matching string, I see there is a post with the position of a character on a string but not one with an array, here is an example of what I want to achieve:
array['potato-salad','cucumber-salad','eggplant-pie','potato-soup']
I want to know where the elements containing the word 'potato' are, so the result should be something like this:
[1,4]
I was trying to obtain the lengths of all elements, then converting the array to string, and searching for the string to see where the string matches and compare if the position can go in between any of the array elements lengths, but this doesn't work if my number of elements in the array is variable, and in my problem it is.