ImmutableList.IndexOf 方法

定義

多載

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

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

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

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

IndexOf<T>(IImmutableList<T>, T)

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

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

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

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

來源:
ImmutableList.cs
來源:
ImmutableList.cs
來源:
ImmutableList.cs

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

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static int IndexOf(System::Collections::Immutable::IImmutableList<T> ^ list, T item, int startIndex);
public static int IndexOf<T> (this System.Collections.Immutable.IImmutableList<T> list, T item, int startIndex);
static member IndexOf : System.Collections.Immutable.IImmutableList<'T> * 'T * int -> int
<Extension()>
Public Function IndexOf(Of T) (list As IImmutableList(Of T), item As T, startIndex As Integer) As Integer

類型參數

T

清單中的項目類型。

參數

list
IImmutableList<T>

要搜尋的清單。

item
T

要在不可變清單中尋找的物件。 參考類型的值可以是 Null。

startIndex
Int32

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

傳回

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

適用於

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

來源:
ImmutableList.cs
來源:
ImmutableList.cs
來源:
ImmutableList.cs

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

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static int IndexOf(System::Collections::Immutable::IImmutableList<T> ^ list, T item, int startIndex, int count);
public static int IndexOf<T> (this System.Collections.Immutable.IImmutableList<T> list, T item, int startIndex, int count);
static member IndexOf : System.Collections.Immutable.IImmutableList<'T> * 'T * int * int -> int
<Extension()>
Public Function IndexOf(Of T) (list As IImmutableList(Of T), item As T, startIndex As Integer, count As Integer) As Integer

類型參數

T

清單中的項目類型。

參數

list
IImmutableList<T>

要搜尋的清單。

item
T

要在不可變清單中尋找的物件。 參考類型的值可以是 Null。

startIndex
Int32

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

count
Int32

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

傳回

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

適用於

IndexOf<T>(IImmutableList<T>, T)

來源:
ImmutableList.cs
來源:
ImmutableList.cs
來源:
ImmutableList.cs

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

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static int IndexOf(System::Collections::Immutable::IImmutableList<T> ^ list, T item);
public static int IndexOf<T> (this System.Collections.Immutable.IImmutableList<T> list, T item);
static member IndexOf : System.Collections.Immutable.IImmutableList<'T> * 'T -> int
<Extension()>
Public Function IndexOf(Of T) (list As IImmutableList(Of T), item As T) As Integer

類型參數

T

清單中的項目類型。

參數

list
IImmutableList<T>

要搜尋的清單。

item
T

要在清單中尋找的物件 參考類型的值可以是 Null。

傳回

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

適用於

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

來源:
ImmutableList.cs
來源:
ImmutableList.cs
來源:
ImmutableList.cs

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

public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
 static int IndexOf(System::Collections::Immutable::IImmutableList<T> ^ list, T item, System::Collections::Generic::IEqualityComparer<T> ^ equalityComparer);
public static int IndexOf<T> (this System.Collections.Immutable.IImmutableList<T> list, T item, System.Collections.Generic.IEqualityComparer<T> equalityComparer);
public static int IndexOf<T> (this System.Collections.Immutable.IImmutableList<T> list, T item, System.Collections.Generic.IEqualityComparer<T>? equalityComparer);
static member IndexOf : System.Collections.Immutable.IImmutableList<'T> * 'T * System.Collections.Generic.IEqualityComparer<'T> -> int
<Extension()>
Public Function IndexOf(Of T) (list As IImmutableList(Of T), item As T, equalityComparer As IEqualityComparer(Of T)) As Integer

類型參數

T

清單中的項目類型。

參數

list
IImmutableList<T>

要搜尋的清單。

item
T

要在不可變清單中尋找的物件。 參考類型的值可以是 Null。

equalityComparer
IEqualityComparer<T>

搜尋中所使用的相等比較子。

傳回

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

適用於