ImmutableList<T>.Builder.IndexOf 方法

定義

多載

IndexOf(T)

搜尋指定的物件,並傳回不可變清單中的項目範圍內第一個出現項目以零為起始的索引。

IndexOf(T, Int32)

搜尋指定的物件,並傳回不可變的清單中,從指定索引開始到最後一個項目的項目範圍內,第一個出現項目以零為起始的索引。

IndexOf(T, Int32, Int32)

搜尋指定的物件,並傳回不可變的清單中,從指定索引開始且包含指定項目數的項目範圍內,第一個出現項目以零為起始的索引。

IndexOf(T, Int32, Int32, IEqualityComparer<T>)

ImmutableList<T>.Builder 中從指定索引開始且包含指定個數項目的範圍內,搜尋指定的物件第一次出現的位置,並傳回其索引值 (索引以零為起始)。

IndexOf(T)

來源:
ImmutableList_1.Builder.cs
來源:
ImmutableList_1.Builder.cs
來源:
ImmutableList_1.Builder.cs

搜尋指定的物件,並傳回不可變清單中的項目範圍內第一個出現項目以零為起始的索引。

public:
 virtual int IndexOf(T item);
public int IndexOf (T item);
abstract member IndexOf : 'T -> int
override this.IndexOf : 'T -> int
Public Function IndexOf (item As T) As Integer

參數

item
T

要位於不可變清單中的物件。 參考類型的值可以是 null

傳回

固定清單中的項目範圍內,第一次出現 item 之以零為起始的索引;如未找到則為 -1。

實作

適用於

IndexOf(T, Int32)

來源:
ImmutableList_1.Builder.cs
來源:
ImmutableList_1.Builder.cs
來源:
ImmutableList_1.Builder.cs

搜尋指定的物件,並傳回不可變的清單中,從指定索引開始到最後一個項目的項目範圍內,第一個出現項目以零為起始的索引。

public:
 int IndexOf(T item, int index);
public int IndexOf (T item, int index);
member this.IndexOf : 'T * int -> int
Public Function IndexOf (item As T, index As Integer) As Integer

參數

item
T

要位於不可變清單中的物件。 參考類型的值可以是 null

index
Int32

搜尋之以零為起始的起始索引。 0 (零) 在空白清單中有效。

傳回

在固定清單中從 index 到最後一個項目的項目範圍內,第一次出現項目之以零為起始的索引;如未找到則為 -1。

適用於

IndexOf(T, Int32, Int32)

來源:
ImmutableList_1.Builder.cs
來源:
ImmutableList_1.Builder.cs
來源:
ImmutableList_1.Builder.cs

搜尋指定的物件,並傳回不可變的清單中,從指定索引開始且包含指定項目數的項目範圍內,第一個出現項目以零為起始的索引。

public:
 int IndexOf(T item, int index, int count);
public int IndexOf (T item, int index, int count);
member this.IndexOf : 'T * int * int -> int
Public Function IndexOf (item As T, index As Integer, count As Integer) As Integer

參數

item
T

要位於不可變清單中的物件。 參考類型的值可以是 null

index
Int32

搜尋之以零為起始的起始索引。 0 (零) 在空白清單中有效。

count
Int32

區段中要搜尋的項目數目。

傳回

在固定清單中從 index 處開始且包含 count 個項目的項目範圍內,第一次出現項目之以零為起始的索引;如未找到則為 -1。

適用於

IndexOf(T, Int32, Int32, IEqualityComparer<T>)

來源:
ImmutableList_1.Builder.cs
來源:
ImmutableList_1.Builder.cs
來源:
ImmutableList_1.Builder.cs

ImmutableList<T>.Builder 中從指定索引開始且包含指定個數項目的範圍內,搜尋指定的物件第一次出現的位置,並傳回其索引值 (索引以零為起始)。

public:
 int IndexOf(T item, int index, int count, System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer);
public int IndexOf (T item, int index, int count, System.Collections.Generic.IEqualityComparer<T> equalityComparer);
public int IndexOf (T item, int index, int count, System.Collections.Generic.IEqualityComparer<T>? equalityComparer);
member this.IndexOf : 'T * int * int * System.Collections.Generic.IEqualityComparer<'T> -> int
Public Function IndexOf (item As T, index As Integer, count As Integer, equalityComparer As IEqualityComparer(Of T)) As Integer

參數

item
T

要位於不可變清單中的物件。 參考類型的值可以是 null

index
Int32

搜尋之以零為起始的起始索引。 0 (零) 在空白清單中有效。

count
Int32

要搜尋的項目數目。

equalityComparer
IEqualityComparer<T>

要用來比較項目是否相等的值比較子。

傳回

在固定清單中從 index 處開始且包含 count 個項目的項目範圍內,第一次出現項目之以零為起始的索引;如未找到則為 -1

適用於