Läs på engelska Redigera

Dela via


MemoryExtensions.ContainsAny Method

Definition

Overloads

ContainsAny(Span<Char>, SearchValues<String>)

Searches for any occurrence of any of the specified substring values.

ContainsAny(ReadOnlySpan<Char>, SearchValues<String>)

Searches for any occurrence of any of the specified substring values.

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

Searches for an occurrence of value0, value1, or value2, and returns true if found. If not found, returns false.

ContainsAny<T>(ReadOnlySpan<T>, T, T, T)

Searches for an occurrence of value0, value1, or value2.

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

Searches for an occurrence of value0 or value1, and returns true if found. If not found, returns false.

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

Searches for an occurrence of any of the specified values.

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

Searches for an occurrence of any of the specified values and returns true if found. If not found, returns false.

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

Searches for an occurrence of any of the specified values and returns true if found. If not found, returns false.

ContainsAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

Searches for an occurrence of any of the specified values.

ContainsAny<T>(ReadOnlySpan<T>, T, T)

Searches for an occurrence of value0 or value1.

ContainsAny(Span<Char>, SearchValues<String>)

Source:
MemoryExtensions.cs

Searches for any occurrence of any of the specified substring values.

C#
[System.Runtime.CompilerServices.OverloadResolutionPriority(-1)]
public static bool ContainsAny(this Span<char> span, System.Buffers.SearchValues<string> values);
C#
public static bool ContainsAny(this Span<char> span, System.Buffers.SearchValues<string> values);

Parameters

span
Span<Char>

The span to search.

values
SearchValues<String>

The set of values to search for.

Returns

true if found. If not found, returns false.

Attributes

Applies to

.NET 10 och .NET 9
Produkt Versioner
.NET 9, 10

ContainsAny(ReadOnlySpan<Char>, SearchValues<String>)

Source:
MemoryExtensions.cs

Searches for any occurrence of any of the specified substring values.

C#
public static bool ContainsAny(this ReadOnlySpan<char> span, System.Buffers.SearchValues<string> values);

Parameters

span
ReadOnlySpan<Char>

The span to search.

values
SearchValues<String>

The set of values to search for.

Returns

true if found. If not found, returns false.

Applies to

.NET 10 och .NET 9
Produkt Versioner
.NET 9, 10

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

C#
public static bool ContainsAny<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
Produkt Versioner
.NET 10

ContainsAny<T>(Span<T>, T, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for an occurrence of value0, value1, or value2, and returns true if found. If not found, returns false.

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

Type Parameters

T

Parameters

span
Span<T>

The span to search.

value0
T

One of the values to search for.

value1
T

One of the values to search for.

value2
T

One of the values to search for.

Returns

true if found. If not found, returns false.

Attributes

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET 8, 9, 10

ContainsAny<T>(ReadOnlySpan<T>, T, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for an occurrence of value0, value1, or value2.

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

Type Parameters

T

Parameters

span
ReadOnlySpan<T>

The span to search.

value0
T

One of the values to search for.

value1
T

One of the values to search for.

value2
T

One of the values to search for.

Returns

true if found. If not found, returns false.

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET 8, 9, 10

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

C#
public static bool ContainsAny<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
Produkt Versioner
.NET 10

ContainsAny<T>(Span<T>, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for an occurrence of value0 or value1, and returns true if found. If not found, returns false.

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

Type Parameters

T

Parameters

span
Span<T>

The span to search.

value0
T

One of the values to search for.

value1
T

One of the values to search for.

Returns

true if found. If not found, returns false.

Attributes

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET 8, 9, 10

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

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for an occurrence of any of the specified values.

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

Type Parameters

T

Parameters

span
ReadOnlySpan<T>

The span to search.

values
SearchValues<T>

The set of values to search for.

Returns

true if found. If not found, returns false.

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET 8, 9, 10

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

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

Type Parameters

T

Parameters

Returns

Applies to

.NET 10
Produkt Versioner
.NET 10

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

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for an occurrence of any of the specified values and returns true if found. If not found, returns false.

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

Type Parameters

T

Parameters

span
Span<T>

The span to search.

values
ReadOnlySpan<T>

The set of values to search for.

Returns

true if found. If not found, returns false.

Attributes

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET 8, 9, 10

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

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for an occurrence of any of the specified values and returns true if found. If not found, returns false.

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

Type Parameters

T

Parameters

span
Span<T>

The span to search.

values
SearchValues<T>

The set of values to search for.

Returns

true if found. If not found, returns false.

Attributes

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET 8, 9, 10

ContainsAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for an occurrence of any of the specified values.

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

Type Parameters

T

Parameters

span
ReadOnlySpan<T>

The span to search.

values
ReadOnlySpan<T>

The set of values to search for.

Returns

true if found. If not found, returns false.

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET 8, 9, 10

ContainsAny<T>(ReadOnlySpan<T>, T, T)

Source:
MemoryExtensions.cs
Source:
MemoryExtensions.cs

Searches for an occurrence of value0 or value1.

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

Type Parameters

T

Parameters

span
ReadOnlySpan<T>

The span to search.

value0
T

One of the values to search for.

value1
T

One of the values to search for.

Returns

true if found. If not found, returns false.

Applies to

.NET 10 och andra versioner
Produkt Versioner
.NET 8, 9, 10