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

13 lines
343 B
Text

+ haystack : ARRAY[STRING];
haystack := "Zig Zag Wally Ronald Bush Krusty Charlie Bush Bozo".split;
"Washington Bush".split.foreach { needle : STRING;
haystack.has(needle).if {
haystack.first_index_of(needle).print;
' '.print;
needle.print;
'\n'.print;
} else {
needle.print;
" is not in haystack\n".print;
};
};