Läs på engelska

Dela via


Vector.IndexOf(Object, Int32) Method

Definition

Returns the index of the first occurrence of the specified element in this vector, searching forwards from index, or returns -1 if the element is not found.

C#
[Android.Runtime.Register("indexOf", "(Ljava/lang/Object;I)I", "GetIndexOf_Ljava_lang_Object_IHandler")]
public virtual int IndexOf (Java.Lang.Object? o, int index);

Parameters

o
Object

element to search for

index
Int32

index to start searching from

Returns

the index of the first occurrence of the element in this vector at position index or later in the vector; -1 if the element is not found.

Attributes

Exceptions

Remarks

Returns the index of the first occurrence of the specified element in this vector, searching forwards from index, or returns -1 if the element is not found. More formally, returns the lowest index i such that (i >= index && Objects.equals(o, get(i))), or -1 if there is no such index.

Java documentation for java.util.Vector.indexOf(java.lang.Object, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

Produkt Versioner
.NET for Android .NET for Android API 34, .NET for Android API 35

See also

  • <xref:Java.Util.Vector.LastIndexOf(Java.Lang.Object%2c+System.Int32)>