Прочетете на английски Редактиране

Споделяне чрез


MemoryExtensions.IndexOfAnyExcept Method

Definition

Overloads

IndexOfAnyExcept<T>(ReadOnlySpan<T>, T, IEqualityComparer<T>)
IndexOfAnyExcept<T>(ReadOnlySpan<T>, T, T, T)

Searches for the first index of any value other than the specified value0, value1, or value2.

IndexOfAnyExcept<T>(ReadOnlySpan<T>, T, T, IEqualityComparer<T>)
IndexOfAnyExcept<T>(Span<T>, T, T)

Searches for the first index of any value other than the specified value0 or value1.

IndexOfAnyExcept<T>(ReadOnlySpan<T>, T, T)

Searches for the first index of any value other than the specified value0 or value1.

IndexOfAnyExcept<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, IEqualityComparer<T>)
IndexOfAnyExcept<T>(Span<T>, T, T, T)

Searches for the first index of any value other than the specified value0, value1, or value2.

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

Searches for the first index of any value other than the specified values.

IndexOfAnyExcept<T>(Span<T>, SearchValues<T>)

Searches for the first index of any value other than the specified values.

IndexOfAnyExcept<T>(ReadOnlySpan<T>, T)

Searches for the first index of any value other than the specified value.

IndexOfAnyExcept<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

Searches for the first index of any value other than the specified values.

IndexOfAnyExcept<T>(ReadOnlySpan<T>, SearchValues<T>)

Searches for the first index of any value other than the specified values.

IndexOfAnyExcept<T>(Span<T>, T)

Searches for the first index of any value other than the specified value.

IndexOfAnyExcept<T>(ReadOnlySpan<T>, T, T, T, IEqualityComparer<T>)

IndexOfAnyExcept<T>(ReadOnlySpan<T>, T, IEqualityComparer<T>)

C#
public static int IndexOfAnyExcept<T>(this ReadOnlySpan<T> span, T value, System.Collections.Generic.IEqualityComparer<T>? comparer = default);

Type Parameters

T

Parameters

value
T

Returns

Applies to

.NET 10
Продукт Версии
.NET 10

IndexOfAnyExcept<T>(ReadOnlySpan<T>, T, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value other than the specified value0, value1, or value2.

C#
public static int IndexOfAnyExcept<T>(this ReadOnlySpan<T> span, T value0, T value1, T value2) where T : IEquatable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
ReadOnlySpan<T>

The span to search.

value0
T

A value to avoid.

value1
T

A value to avoid

value2
T

A value to avoid

Returns

The index in the span of the first occurrence of any value other than value0, value1, and value2. If all of the values are value0, value1, and value2, returns -1.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

IndexOfAnyExcept<T>(ReadOnlySpan<T>, T, T, IEqualityComparer<T>)

C#
public static int IndexOfAnyExcept<T>(this ReadOnlySpan<T> span, T value0, T value1, System.Collections.Generic.IEqualityComparer<T>? comparer = default);

Type Parameters

T

Parameters

value0
T
value1
T

Returns

Applies to

.NET 10
Продукт Версии
.NET 10

IndexOfAnyExcept<T>(Span<T>, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value other than the specified value0 or value1.

C#
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static int IndexOfAnyExcept<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>;
C#
public static int IndexOfAnyExcept<T>(this Span<T> span, T value0, T value1) where T : IEquatable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
Span<T>

The span to search.

value0
T

A value to avoid.

value1
T

A value to avoid

Returns

The index in the span of the first occurrence of any value other than value0 and value1. If all of the values are value0 or value1, returns -1.

Attributes

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

IndexOfAnyExcept<T>(ReadOnlySpan<T>, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value other than the specified value0 or value1.

C#
public static int IndexOfAnyExcept<T>(this ReadOnlySpan<T> span, T value0, T value1) where T : IEquatable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
ReadOnlySpan<T>

The span to search.

value0
T

A value to avoid.

value1
T

A value to avoid

Returns

The index in the span of the first occurrence of any value other than value0 and value1. If all of the values are value0 or value1, returns -1.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

IndexOfAnyExcept<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, IEqualityComparer<T>)

C#
public static int IndexOfAnyExcept<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values, System.Collections.Generic.IEqualityComparer<T>? comparer = default);

Type Parameters

T

Parameters

Returns

Applies to

.NET 10
Продукт Версии
.NET 10

IndexOfAnyExcept<T>(Span<T>, T, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value other than the specified value0, value1, or value2.

C#
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static int IndexOfAnyExcept<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>;
C#
public static int IndexOfAnyExcept<T>(this Span<T> span, T value0, T value1, T value2) where T : IEquatable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
Span<T>

The span to search.

value0
T

A value to avoid.

value1
T

A value to avoid

value2
T

A value to avoid

Returns

The index in the span of the first occurrence of any value other than value0, value1, and value2. If all of the values are value0, value1, and value2, returns -1.

Attributes

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

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

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value other than the specified values.

C#
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static int IndexOfAnyExcept<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>;
C#
public static int IndexOfAnyExcept<T>(this Span<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
Span<T>

The span to search.

values
ReadOnlySpan<T>

The values to avoid.

Returns

The index in the span of the first occurrence of any value other than those in values. If all of the values are in values, returns -1.

Attributes

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

IndexOfAnyExcept<T>(Span<T>, SearchValues<T>)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value other than the specified values.

C#
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static int IndexOfAnyExcept<T>(this Span<T> span, System.Buffers.SearchValues<T> values) where T : IEquatable<T>;
C#
public static int IndexOfAnyExcept<T>(this Span<T> span, System.Buffers.SearchValues<T> values) where T : IEquatable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
Span<T>

The span to search.

values
SearchValues<T>

The values to exclude from the search.

Returns

The index in the span of the first occurrence of any value other than those in values. If all of the values are in values, returns -1.

Attributes

Applies to

.NET 10 и други версии
Продукт Версии
.NET 8, 9, 10

IndexOfAnyExcept<T>(ReadOnlySpan<T>, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value other than the specified value.

C#
public static int IndexOfAnyExcept<T>(this ReadOnlySpan<T> span, T value) where T : IEquatable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
ReadOnlySpan<T>

The span to search.

value
T

A value to avoid.

Returns

The index in the span of the first occurrence of any value other than value. If all of the values are value, returns -1.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

IndexOfAnyExcept<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value other than the specified values.

C#
public static int IndexOfAnyExcept<T>(this ReadOnlySpan<T> span, ReadOnlySpan<T> values) where T : IEquatable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
ReadOnlySpan<T>

The span to search.

values
ReadOnlySpan<T>

The values to avoid.

Returns

The index in the span of the first occurrence of any value other than those in values. If all of the values are in values, returns -1.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

IndexOfAnyExcept<T>(ReadOnlySpan<T>, SearchValues<T>)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value other than the specified values.

C#
public static int IndexOfAnyExcept<T>(this ReadOnlySpan<T> span, System.Buffers.SearchValues<T> values) where T : IEquatable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
ReadOnlySpan<T>

The span to search.

values
SearchValues<T>

The values to exclude from the search.

Returns

The index in the span of the first occurrence of any value other than those in values. If all of the values are in values, returns -1.

Applies to

.NET 10 и други версии
Продукт Версии
.NET 8, 9, 10

IndexOfAnyExcept<T>(Span<T>, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for the first index of any value other than the specified value.

C#
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static int IndexOfAnyExcept<T>(this Span<T> span, T value) where T : IEquatable<T>;
C#
public static int IndexOfAnyExcept<T>(this Span<T> span, T value) where T : IEquatable<T>;

Type Parameters

T

The type of the span and values.

Parameters

span
Span<T>

The span to search.

value
T

A value to avoid.

Returns

The index in the span of the first occurrence of any value other than value. If all of the values are value, returns -1.

Attributes

Applies to

.NET 10 и други версии
Продукт Версии
.NET 7, 8, 9, 10

IndexOfAnyExcept<T>(ReadOnlySpan<T>, T, T, T, IEqualityComparer<T>)

C#
public static int IndexOfAnyExcept<T>(this ReadOnlySpan<T> span, T value0, T value1, T value2, System.Collections.Generic.IEqualityComparer<T>? comparer = default);

Type Parameters

T

Parameters

value0
T
value1
T
value2
T

Returns

Applies to

.NET 10
Продукт Версии
.NET 10