ImmutableList.IndexOf 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| 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)
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- 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 (零)在空列表中有效。
返回
在 Immutable 列表中从索引扩展到最后一个元素的不可变列表中项的第一个匹配项的从零开始的索引(如果找到);否则为 -1。
适用于
IndexOf<T>(IImmutableList<T>, T, Int32, Int32)
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- 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
要搜索的节中的元素数。
返回
在 Immutable 列表中从索引扩展到最后一个元素的不可变列表中项的第一个匹配项的从零开始的索引(如果找到);否则为 -1。
适用于
IndexOf<T>(IImmutableList<T>, T)
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- 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>)
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- ImmutableList.cs
- Source:
- 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。