MemoryExtensions.IndexOfAny MemoryExtensions.IndexOfAny MemoryExtensions.IndexOfAny MemoryExtensions.IndexOfAny Method

定义

重载

IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

IndexOfAny<T>(Span<T>, ReadOnlySpan<T>) IndexOfAny<T>(Span<T>, ReadOnlySpan<T>) IndexOfAny<T>(Span<T>, ReadOnlySpan<T>) IndexOfAny<T>(Span<T>, ReadOnlySpan<T>)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

IndexOfAny<T>(ReadOnlySpan<T>, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

IndexOfAny<T>(Span<T>, T, T) IndexOfAny<T>(Span<T>, T, T) IndexOfAny<T>(Span<T>, T, T) IndexOfAny<T>(Span<T>, T, T)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

IndexOfAny<T>(ReadOnlySpan<T>, T, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T, T)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

IndexOfAny<T>(Span<T>, T, T, T) IndexOfAny<T>(Span<T>, T, T, T) IndexOfAny<T>(Span<T>, T, T, T) IndexOfAny<T>(Span<T>, T, T, T)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static int IndexOfAny(ReadOnlySpan<T> span, ReadOnlySpan<T> values);
public static int IndexOfAny<T> (this ReadOnlySpan<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>;
static member IndexOfAny : ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> int (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function IndexOfAny(Of T As IEquatable(Of T)) (span As ReadOnlySpan(Of T), values As ReadOnlySpan(Of T)) As Integer

类型参数

T

范围和值的类型。The type of the span and values.

参数

span
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要搜索的跨度。The span to search.

values
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要搜索的值集。The set of values to search for.

返回

跨度中任何值出现的第一个索引。The first index of the occurrence of any of the values in the span. 如果未找到,则返回 -1。If not found, returns -1.

IndexOfAny<T>(Span<T>, ReadOnlySpan<T>) IndexOfAny<T>(Span<T>, ReadOnlySpan<T>) IndexOfAny<T>(Span<T>, ReadOnlySpan<T>) IndexOfAny<T>(Span<T>, ReadOnlySpan<T>)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static int IndexOfAny(Span<T> span, ReadOnlySpan<T> values);
public static int IndexOfAny<T> (this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>;
static member IndexOfAny : Span<'T (requires 'T :> IEquatable<'T>)> * ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> -> int (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function IndexOfAny(Of T As IEquatable(Of T)) (span As Span(Of T), values As ReadOnlySpan(Of T)) As Integer

类型参数

T

范围和值的类型。The type of the span and values.

参数

span
Span<T> Span<T> Span<T> Span<T>

要搜索的跨度。The span to search.

values
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要搜索的值集。The set of values to search for.

返回

跨度中任何值出现的第一个索引。The first index of the occurrence of any of the values in the span. 如果未找到,则返回 -1。If not found, returns -1.

IndexOfAny<T>(ReadOnlySpan<T>, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static int IndexOfAny(ReadOnlySpan<T> span, T value0, T value1);
public static int IndexOfAny<T> (this ReadOnlySpan<T> span, T value0, T value1) where T : IEquatable<T>;
static member IndexOfAny : ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> * 'T * 'T -> int (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function IndexOfAny(Of T As IEquatable(Of T)) (span As ReadOnlySpan(Of T), value0 As T, value1 As T) As Integer

类型参数

T

范围和值的类型。The type of the span and values.

参数

span
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要搜索的跨度。The span to search.

value0

要搜索的其中某个值。One of the values to search for.

value1

要搜索的其中某个值。One of the values to search for.

返回

跨度中任何值出现的第一个索引。The first index of the occurrence of any of the values in the span. 如果未找到,则返回 -1。If not found, returns -1.

IndexOfAny<T>(Span<T>, T, T) IndexOfAny<T>(Span<T>, T, T) IndexOfAny<T>(Span<T>, T, T) IndexOfAny<T>(Span<T>, T, T)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static int IndexOfAny(Span<T> span, T value0, T value1);
public static int IndexOfAny<T> (this Span<T> span, T value0, T value1) where T : IEquatable<T>;
static member IndexOfAny : Span<'T (requires 'T :> IEquatable<'T>)> * 'T * 'T -> int (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function IndexOfAny(Of T As IEquatable(Of T)) (span As Span(Of T), value0 As T, value1 As T) As Integer

类型参数

T

范围和值的类型。The type of the span and values.

参数

span
Span<T> Span<T> Span<T> Span<T>

要搜索的跨度。The span to search.

value0

要搜索的其中某个值。One of the values to search for.

value1

要搜索的其中某个值。One of the values to search for.

返回

跨度中任何值出现的第一个索引。The first index of the occurrence of any of the values in the span. 如果未找到,则返回 -1。If not found, returns -1.

IndexOfAny<T>(ReadOnlySpan<T>, T, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T, T)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static int IndexOfAny(ReadOnlySpan<T> span, T value0, T value1, T value2);
public static int IndexOfAny<T> (this ReadOnlySpan<T> span, T value0, T value1, T value2) where T : IEquatable<T>;
static member IndexOfAny : ReadOnlySpan<'T (requires 'T :> IEquatable<'T>)> * 'T * 'T * 'T -> int (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function IndexOfAny(Of T As IEquatable(Of T)) (span As ReadOnlySpan(Of T), value0 As T, value1 As T, value2 As T) As Integer

类型参数

T

范围和值的类型。The type of the span and values.

参数

span
ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T>

要搜索的跨度。The span to search.

value0

要搜索的其中某个值。One of the values to search for.

value1

要搜索的其中某个值。One of the values to search for.

value2

要搜索的其中某个值。One of the values to search for.

返回

跨度中任何值出现的第一个索引。The first index of the occurrence of any of the values in the span. 如果未找到,则返回 -1。If not found, returns -1.

IndexOfAny<T>(Span<T>, T, T, T) IndexOfAny<T>(Span<T>, T, T, T) IndexOfAny<T>(Span<T>, T, T, T) IndexOfAny<T>(Span<T>, T, T, T)

搜索任何指定值的第一个索引,其方式类似于使用逻辑 OR 运算符多次调用 IndexOf。Searches for the first index of any of the specified values similar to calling IndexOf several times with the logical OR operator.

public:
generic <typename T>
 where T : IEquatable<T>[System::Runtime::CompilerServices::Extension]
 static int IndexOfAny(Span<T> span, T value0, T value1, T value2);
public static int IndexOfAny<T> (this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>;
static member IndexOfAny : Span<'T (requires 'T :> IEquatable<'T>)> * 'T * 'T * 'T -> int (requires 'T :> IEquatable<'T>)
<Extension()>
Public Function IndexOfAny(Of T As IEquatable(Of T)) (span As Span(Of T), value0 As T, value1 As T, value2 As T) As Integer

类型参数

T

范围和值的类型。The type of the span and values.

参数

span
Span<T> Span<T> Span<T> Span<T>

要搜索的跨度。The span to search.

value0

要搜索的其中某个值。One of the values to search for.

value1

要搜索的其中某个值。One of the values to search for.

value2

要搜索的其中某个值。One of the values to search for.

返回

跨度中任何值出现的第一个索引。The first index of the occurrence of any of the values in the span. 如果未找到,则返回 -1。If not found, returns -1.

适用于