Navigation
Synopsis Return index of last occurrence of elt in lst, or -1 if elt is not found.
Function int lastIndexOf(list[&T] lst, &T elt)
Usage import List;
Description Also see indexOf.
Examples
rascal>import List;
ok
rascal>lastIndexOf([3, 1, 4, 5, 4], 4);
int: 4
rascal>lastIndexOf([3, 1, 4, 5, 4], 7);
int: -1
rascal>lastIndexOf(["zebra", "owl", "elephant", "snake", "owl"], "owl");
int: 4

Questions
Question [1].
The type of lastIndexOf([-11, -10, -3, -9, 10, 2], -11) is

Question [2].
lastIndexOf(["Sesame","Apple","Sy Snootles","Sy Snootles","Apple","Sesame"], "Sy Snootles") == 



Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.