11 lines
231 B
Text
11 lines
231 B
Text
haystack = ["apples", "oranges", "bananas", "oranges"]
|
|
needle = "oranges"
|
|
|
|
pos = haystack.getPos(needle)
|
|
if pos then
|
|
put "needle found at index "&pos
|
|
else
|
|
put "needle not found in haystack"
|
|
end if
|
|
|
|
-- "needle found at index 2"
|