how to array in ROS

hello, how i do if condition and array in ros?

for example, there is variable a and 192.168.2.1,192.168.2.2,192.168.2.3 as it value.

if ($a = 192.168.2.2) do= {:put "success};

i’m sory this is my learn for scripting, not really problem.

help me please, i’m begginer in scripting :slight_smile:

you can look up that in wiki manual, one example

:foreach item in <your_arrray> do={
:if ($item == “asdf”) do={
:put “success”;
}}

thanks for answer Mr. Janisk, i’ll try. :slight_smile: