RosettaCodeData/Task/Search-a-list/Lingo/search-a-list.lingo
2023-07-01 13:44:08 -04:00

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"