MemoryExtensions.CommonPrefixLength 方法    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| CommonPrefixLength<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) | 
						 查找 和   | 
        	
| CommonPrefixLength<T>(Span<T>, ReadOnlySpan<T>) | 
						 查找 和   | 
        	
| CommonPrefixLength<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, IEqualityComparer<T>) | 
						 确定 和   | 
        	
| CommonPrefixLength<T>(Span<T>, ReadOnlySpan<T>, IEqualityComparer<T>) | 
						 查找 和   | 
        	
CommonPrefixLength<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)
- Source:
 - MemoryExtensions.cs
 
- Source:
 - MemoryExtensions.cs
 
- Source:
 - MemoryExtensions.cs
 
查找 和 other之间span共享的任何通用前缀的长度。
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
    类型参数
- T
 
范围中元素的类型。
参数
- span
 - ReadOnlySpan<T>
 
要比较的第一个序列。
- other
 - ReadOnlySpan<T>
 
要比较的第二个序列。
返回
两个跨度共享的公共前缀的长度。 如果没有共享前缀,则返回 0。
适用于
CommonPrefixLength<T>(Span<T>, ReadOnlySpan<T>)
- Source:
 - MemoryExtensions.cs
 
- Source:
 - MemoryExtensions.cs
 
- Source:
 - MemoryExtensions.cs
 
查找 和 other之间span共享的任何通用前缀的长度。
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
    类型参数
- T
 
范围中元素的类型。
参数
- span
 - Span<T>
 
要比较的第一个序列。
- other
 - ReadOnlySpan<T>
 
要比较的第二个序列。
返回
两个跨度共享的公共前缀的长度。 如果没有共享前缀,则返回 0。
适用于
CommonPrefixLength<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, IEqualityComparer<T>)
- Source:
 - MemoryExtensions.cs
 
- Source:
 - MemoryExtensions.cs
 
- Source:
 - MemoryExtensions.cs
 
确定 和 other之间共享的任何通用前缀的span长度。
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
    类型参数
- T
 
序列中元素的类型。
参数
- span
 - ReadOnlySpan<T>
 
要比较的第一个序列。
- other
 - ReadOnlySpan<T>
 
要比较的第二个序列。
- comparer
 - IEqualityComparer<T>
 
比较 IEqualityComparer<T> 元素时要使用的实现,或者 null 对元素的类型使用默认值 IEqualityComparer<T> 。
返回
两个跨度共享的公共前缀的长度。 如果没有共享前缀,则返回 0。
适用于
CommonPrefixLength<T>(Span<T>, ReadOnlySpan<T>, IEqualityComparer<T>)
- Source:
 - MemoryExtensions.cs
 
- Source:
 - MemoryExtensions.cs
 
- Source:
 - MemoryExtensions.cs
 
查找 和 other之间span共享的任何通用前缀的长度。
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
    类型参数
- T
 
范围中元素的类型。
参数
- span
 - Span<T>
 
要比较的第一个序列。
- other
 - ReadOnlySpan<T>
 
要比较的第二个序列。
- comparer
 - IEqualityComparer<T>
 
比较 IEqualityComparer<T> 元素时要使用的实现,或者 null 对元素的类型使用默认值 IEqualityComparer<T> 。
返回
两个跨度共享的公共前缀的长度。 如果没有共享前缀,则返回 0。