Returns the last index position of a specified element within a list, or -1 if the list does not contain the specified element.
$[ScriptVariable]::lastIndexOf(String str)
str (String): the list element to search for within the list.
The following example illustrates the syntax for the lastIndexOf list method (using the $recipients list variable created in the add example):
$recipients::add("Building 14")
$position = $recipients::lastIndexOf("Building 14")
$position2 = $recipients::lastIndexOf("This is not in the list")
print($position)
print($position2)
3
-1