RosettaCodeData/Task/Search-a-list/Zkl/search-a-list-2.zkl
2017-09-25 22:28:19 +02:00

3 lines
184 B
Text

haystack:=L("Krusty","Charlie","Bozo","Bozo");
haystack.filterNs('==("Bozo"))[-1]; // -->3, indexError if not found
haystack.len() - 1 - haystack.reverse().index("Bozo"); // or this