MemoryExtensions.CommonPrefixLength Méthode
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
CommonPrefixLength<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) |
Recherche la longueur de tout préfixe commun partagé entre |
CommonPrefixLength<T>(Span<T>, ReadOnlySpan<T>) |
Recherche la longueur de tout préfixe commun partagé entre |
CommonPrefixLength<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, IEqualityComparer<T>) |
Détermine la longueur de tout préfixe commun partagé entre |
CommonPrefixLength<T>(Span<T>, ReadOnlySpan<T>, IEqualityComparer<T>) |
Recherche la longueur de tout préfixe commun partagé entre |
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Recherche la longueur de tout préfixe commun partagé entre span
et other
.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static int CommonPrefixLength(ReadOnlySpan<T> span, ReadOnlySpan<T> other);
public static int CommonPrefixLength<T> (this ReadOnlySpan<T> span, ReadOnlySpan<T> other);
static member CommonPrefixLength : ReadOnlySpan<'T> * ReadOnlySpan<'T> -> int
<Extension()>
Public Function CommonPrefixLength(Of T) (span As ReadOnlySpan(Of T), other As ReadOnlySpan(Of T)) As Integer
Paramètres de type
- T
Type des éléments dans les étendues.
Paramètres
- span
- ReadOnlySpan<T>
Première séquence à comparer.
- other
- ReadOnlySpan<T>
Seconde séquence à comparer.
Retours
Longueur du préfixe commun partagé par les deux étendues. S’il n’existe aucun préfixe partagé, 0 est retourné.
S’applique à
.NET 9 et autres versions
Produit | Versions |
---|---|
.NET | 7, 8, 9 |
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Recherche la longueur de tout préfixe commun partagé entre span
et other
.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static int CommonPrefixLength(Span<T> span, ReadOnlySpan<T> other);
public static int CommonPrefixLength<T> (this Span<T> span, ReadOnlySpan<T> other);
static member CommonPrefixLength : Span<'T> * ReadOnlySpan<'T> -> int
<Extension()>
Public Function CommonPrefixLength(Of T) (span As Span(Of T), other As ReadOnlySpan(Of T)) As Integer
Paramètres de type
- T
Type des éléments dans les étendues.
Paramètres
- span
- Span<T>
Première séquence à comparer.
- other
- ReadOnlySpan<T>
Seconde séquence à comparer.
Retours
Longueur du préfixe commun partagé par les deux étendues. S’il n’existe aucun préfixe partagé, 0 est retourné.
S’applique à
.NET 9 et autres versions
Produit | Versions |
---|---|
.NET | 7, 8, 9 |
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Détermine la longueur de tout préfixe commun partagé entre span
et other
.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static int CommonPrefixLength(ReadOnlySpan<T> span, ReadOnlySpan<T> other, System::Collections::Generic::IEqualityComparer<T> ^ comparer);
public static int CommonPrefixLength<T> (this ReadOnlySpan<T> span, ReadOnlySpan<T> other, System.Collections.Generic.IEqualityComparer<T>? comparer);
static member CommonPrefixLength : ReadOnlySpan<'T> * ReadOnlySpan<'T> * System.Collections.Generic.IEqualityComparer<'T> -> int
<Extension()>
Public Function CommonPrefixLength(Of T) (span As ReadOnlySpan(Of T), other As ReadOnlySpan(Of T), comparer As IEqualityComparer(Of T)) As Integer
Paramètres de type
- T
Type des éléments dans les séquences.
Paramètres
- span
- ReadOnlySpan<T>
Première séquence à comparer.
- other
- ReadOnlySpan<T>
Seconde séquence à comparer.
- comparer
- IEqualityComparer<T>
Implémentation IEqualityComparer<T> à utiliser lors de la comparaison d’éléments ou null
pour utiliser la valeur par défaut IEqualityComparer<T> pour le type d’un élément.
Retours
Longueur du préfixe commun partagé par les deux étendues. S’il n’existe aucun préfixe partagé, 0 est retourné.
S’applique à
.NET 9 et autres versions
Produit | Versions |
---|---|
.NET | 7, 8, 9 |
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
- Source:
- MemoryExtensions.cs
Recherche la longueur de tout préfixe commun partagé entre span
et other
.
public:
generic <typename T>
[System::Runtime::CompilerServices::Extension]
static int CommonPrefixLength(Span<T> span, ReadOnlySpan<T> other, System::Collections::Generic::IEqualityComparer<T> ^ comparer);
public static int CommonPrefixLength<T> (this Span<T> span, ReadOnlySpan<T> other, System.Collections.Generic.IEqualityComparer<T>? comparer);
static member CommonPrefixLength : Span<'T> * ReadOnlySpan<'T> * System.Collections.Generic.IEqualityComparer<'T> -> int
<Extension()>
Public Function CommonPrefixLength(Of T) (span As Span(Of T), other As ReadOnlySpan(Of T), comparer As IEqualityComparer(Of T)) As Integer
Paramètres de type
- T
Type des éléments dans les étendues.
Paramètres
- span
- Span<T>
Première séquence à comparer.
- other
- ReadOnlySpan<T>
Seconde séquence à comparer.
- comparer
- IEqualityComparer<T>
Implémentation IEqualityComparer<T> à utiliser lors de la comparaison d’éléments ou null
pour utiliser la valeur par défaut IEqualityComparer<T> pour le type d’un élément.
Retours
Longueur du préfixe commun partagé par les deux étendues. S’il n’existe aucun préfixe partagé, 0 est retourné.
S’applique à
.NET 9 et autres versions
Produit | Versions |
---|---|
.NET | 7, 8, 9 |
Commentaires sur .NET
.NET est un projet open source. Sélectionnez un lien pour fournir des commentaires :