indexOf


Description:

public int indexOf (T element)

Returns the index of the first occurrence of the specified element. Returns -1 if the element is not found. Uses the equality function provided in the constructor, or pointer equality if none was provided.

Example:

    var list = new ArrayList<string> (GLib.str_equal);
list.add ("a");
list.add ("b");
assert (list.indexOf ("b") == 1);
assert (list.indexOf ("z") == -1);

Parameters:

element

the element to search for.

Returns:

the index of the element, or -1 if not found.