public lastIndexOf(item as T, start as Int = -1) as Int
Returns the last index of the given element.
| Parameter | Description |
|---|---|
item | The element to search for. |
start | Zero-based index where the reverse search starts. -1 starts at the end. |
The last matching index, or -1 when the element is absent.
import klyn.collections values as IList<Int> = [10, 20, 10] print(values.lastIndexOf(10)) # 2 print(values.lastIndexOf(10, 1)) # 0