Hi,
I have an array with a bunch of strings and need to search inside those strings. For example, array.at(0,0) has value "I love chocolate chip cookies". How do I find out if the word "chocolate" is in that string?
I tried array compare at XY but I think that is for exact matches only...
Thank you :)
You can loop through all array elements and use find() expression.
Array for each element find(Array.CurValue, "chocolate")>=0
Wouldn't that condition be true even if "chocolate" is not at (0,0) but is at (0,7)?
For a 2D array use "Array For each XY", or two nested "System For" loops.
Develop games in your browser. Powerful, performant & highly capable.
I'm sorry, but I don't see the Array For each XY option:
am I missing something?
"For each element", and then you can select: X, XY or XYZ.
If you only need to search in one row or column of the array (say at Y=7), I suggest using System For loop.
System For "x" from 0 to Array.width-1 find(Array.at(loopindex,7), "chocolate")>=0
Thank you, will give it a go - I asume it's System For loop and then System Compare two values :)
Correct.