List::index_of()
If value is present in this list, return the index of the first instance.
value
["A", "B"].index_of("B") //-> Some(1) ["A", "B", "B"].index_of("B") //-> Some(1) ["A", "B"].index_of("C") //-> None
public method index_of<T>(this: List<T>, value: T): Option<Int> { for (i, v) in this.enumerate() { if v == value { return Some(i) } } None }