![]() |
|
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].
![]() ![]()
Question [2].
![]() ![]() ![]() |