ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> ReadOnlySpan<T> Struct

정의

인접한 임의의 메모리 영역에 대해 형식이 안전하고 메모리가 안전한 읽기 전용 표현을 제공합니다.Provides a type-safe and memory-safe read-only representation of a contiguous region of arbitrary memory.

generic <typename T>
public value class ReadOnlySpan
public struct ReadOnlySpan<T>
type ReadOnlySpan<'T> = struct
Public Structure ReadOnlySpan(Of T)

형식 매개 변수

T

항목의 형식은 ReadOnlySpan<T>합니다.The type of items in the ReadOnlySpan<T>.

상속
ReadOnlySpan<T>ReadOnlySpan<T>ReadOnlySpan<T>ReadOnlySpan<T>

설명

ReadOnlySpan<T> ref 구조체 스택에 할당을 관리 되는 힙에 이스케이프 되지 않습니다 수 있습니다.ReadOnlySpan<T> is a ref struct that is allocated on the stack and can never escape to the managed heap. Ref 구조체 형식을 제한 하는 수준을 올릴 수 없습니다는 이러한 없습니다 넣을, 형식의 변수에 할당 된 람다 식의 캡처를 포함 하 여 관리 되는 힙에 하도록 많은 Object에 할당 된, dynamic 변수 및 임의의 인터페이스 형식을 구현할 수 없습니다.Ref struct types have a number of restrictions to ensure that they cannot be promoted to the managed heap, including that they can't be boxed, captured in lambda expressions, assigned to variables of type Object, assigned to dynamic variables, and they cannot implement any interface type.

ReadOnlySpan<T> 인스턴스는 배열의 요소 또는 그 일부의 배열 참조 하는 데 자주 사용 됩니다.A ReadOnlySpan<T> instance is often used to reference the elements of an array or a portion of an array. 그러나 배열 달리를 ReadOnlySpan<T> 인스턴스는 기본 메모리 관리 되는 메모리를 가리킬 수 또는 메모리에서 관리 되는 스택.Unlike an array, however, a ReadOnlySpan<T> instance can point to managed memory, native memory, or memory managed on the stack.

생성자

ReadOnlySpan<T>(T[]) ReadOnlySpan<T>(T[]) ReadOnlySpan<T>(T[]) ReadOnlySpan<T>(T[])

지정된 배열 전체에 새로운 ReadOnlySpan<T>을 만듭니다.Creates a new ReadOnlySpan<T> over the entirety of a specified array.

ReadOnlySpan<T>(Void*, Int32) ReadOnlySpan<T>(Void*, Int32) ReadOnlySpan<T>(Void*, Int32) ReadOnlySpan<T>(Void*, Int32)

지정된 메모리 주소에서 시작하는 지정된 바이트 수로부터 새 ReadOnlySpan<T>을 만듭니다.Creates a new ReadOnlySpan<T> from a specified number of bytes starting at a specified memory address.

ReadOnlySpan<T>(T[], Int32, Int32) ReadOnlySpan<T>(T[], Int32, Int32) ReadOnlySpan<T>(T[], Int32, Int32) ReadOnlySpan<T>(T[], Int32, Int32)

지정된 인덱스에서 시작하는 배열의 지정된 요소 수를 포함하는 새 ReadOnlySpan<T>을 만듭니다.Creates a new ReadOnlySpan<T> that includes a specified number of elements of an array starting at a specified index.

속성

Empty Empty Empty Empty

ReadOnlySpan<T> 반환합니다.Returns an empty ReadOnlySpan<T>.

IsEmpty IsEmpty IsEmpty IsEmpty

현재 읽기 전용 범위가 비어 있음을 나타내는 값을 반환합니다.Returns a value that indicates the current read-only span is empty.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

지정한 0 기반 인덱스의 읽기 전용 범위에서 항목을 가져옵니다.Gets an item from the read-only span at the specified zero-based index.

Item[Range] Item[Range] Item[Range] Item[Range]
Item[Index] Item[Index] Item[Index] Item[Index]
Length Length Length Length

읽기 전용 범위에서 항목 수입니다.The number of items in the read-only span.

메서드

CopyTo(Span<T>) CopyTo(Span<T>) CopyTo(Span<T>) CopyTo(Span<T>)

ReadOnlySpan<T>의 콘텐츠를 대상 Span<T>로 복사합니다.Copies the contents of this ReadOnlySpan<T> into a destination Span<T>.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

지원되지 않습니다.Not supported. NotSupportedException를 throw합니다.Throws a NotSupportedException.

GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

ReadOnlySpan<T>에 대한 열거자를 반환합니다.Returns an enumerator for this ReadOnlySpan<T>.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

지원되지 않습니다.Not supported. NotSupportedException를 throw합니다.Throws a NotSupportedException.

Slice(Index) Slice(Index) Slice(Index) Slice(Index)
Slice(Int32) Slice(Int32) Slice(Int32) Slice(Int32)

지정된 인덱스로 시작되는 현재 읽기 전용 범위에서 하나의 조각을 형성합니다.Forms a slice out of the current read-only span that begins at a specified index.

Slice(Range) Slice(Range) Slice(Range) Slice(Range)
Slice(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32) Slice(Int32, Int32)

지정된 길이에 대해 지정된 인덱스에서 시작하는 현재 읽기 전용 범위에서 벗어난 조각을 형성합니다.Forms a slice out of the current read-only span starting at a specified index for a specified length.

ToArray() ToArray() ToArray() ToArray()

이 읽기 전용 범위의 콘텐츠를 새 배열로 복사합니다.Copies the contents of this read-only span into a new array.

ToString() ToString() ToString() ToString()

ReadOnlySpan<T>의 문자열 표현을 반환합니다.Returns the string representation of this ReadOnlySpan<T>.

TryCopyTo(Span<T>) TryCopyTo(Span<T>) TryCopyTo(Span<T>) TryCopyTo(Span<T>)

ReadOnlySpan<T>의 내용을 Span<T>으로 복사하고자 시도하고 작업 성공 여부를 나타내는 값을 반환합니다.Attempts to copy the contents of this ReadOnlySpan<T> into a Span<T> and returns a value to indicate whether or not the operation succeeded.

연산자

Equality(ReadOnlySpan<T>, ReadOnlySpan<T>) Equality(ReadOnlySpan<T>, ReadOnlySpan<T>) Equality(ReadOnlySpan<T>, ReadOnlySpan<T>) Equality(ReadOnlySpan<T>, ReadOnlySpan<T>)

ReadOnlySpan<T> 인스턴스가 같은지 여부를 나타내는 값을 반환합니다.Returns a value that indicates whether two ReadOnlySpan<T> instances are equal.

Implicit(ArraySegment<T> to ReadOnlySpan<T>) Implicit(ArraySegment<T> to ReadOnlySpan<T>) Implicit(ArraySegment<T> to ReadOnlySpan<T>) Implicit(ArraySegment<T> to ReadOnlySpan<T>)

ArraySegment<T>ReadOnlySpan<T>로 변환하는 암시적 변환을 정의합니다.Defines an implicit conversion of an ArraySegment<T> to a ReadOnlySpan<T>.

Implicit(T[] to ReadOnlySpan<T>) Implicit(T[] to ReadOnlySpan<T>) Implicit(T[] to ReadOnlySpan<T>) Implicit(T[] to ReadOnlySpan<T>)

배열을 ReadOnlySpan<T>로 변환하는 암시적 변환을 정의합니다.Defines an implicit conversion of an array to a ReadOnlySpan<T>.

Inequality(ReadOnlySpan<T>, ReadOnlySpan<T>) Inequality(ReadOnlySpan<T>, ReadOnlySpan<T>) Inequality(ReadOnlySpan<T>, ReadOnlySpan<T>) Inequality(ReadOnlySpan<T>, ReadOnlySpan<T>)

ReadOnlySpan<T> 인스턴스가 다른지 여부를 나타내는 값을 반환합니다.Returns a value that indicates whether two ReadOnlySpan<T> instances are not equal.

Extension Methods

BinarySearch<T>(ReadOnlySpan<T>, IComparable<T>) BinarySearch<T>(ReadOnlySpan<T>, IComparable<T>) BinarySearch<T>(ReadOnlySpan<T>, IComparable<T>) BinarySearch<T>(ReadOnlySpan<T>, IComparable<T>)
BinarySearch<T,TComparer>(ReadOnlySpan<T>, T, TComparer) BinarySearch<T,TComparer>(ReadOnlySpan<T>, T, TComparer) BinarySearch<T,TComparer>(ReadOnlySpan<T>, T, TComparer) BinarySearch<T,TComparer>(ReadOnlySpan<T>, T, TComparer)
BinarySearch<T,TComparable>(ReadOnlySpan<T>, TComparable) BinarySearch<T,TComparable>(ReadOnlySpan<T>, TComparable) BinarySearch<T,TComparable>(ReadOnlySpan<T>, TComparable) BinarySearch<T,TComparable>(ReadOnlySpan<T>, TComparable)
CompareTo(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) CompareTo(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) CompareTo(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) CompareTo(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison)
Contains(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) Contains(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) Contains(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) Contains(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison)
EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) EndsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison)
EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) EndsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)
Equals(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) Equals(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) Equals(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) Equals(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison)
IndexOf(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) IndexOf(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) IndexOf(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) IndexOf(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison)
IndexOf<T>(ReadOnlySpan<T>, T) IndexOf<T>(ReadOnlySpan<T>, T) IndexOf<T>(ReadOnlySpan<T>, T) IndexOf<T>(ReadOnlySpan<T>, T)
IndexOf<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOf<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOf<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOf<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)
IndexOfAny<T>(ReadOnlySpan<T>, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T) IndexOfAny<T>(ReadOnlySpan<T>, T, T)
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)
IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) IndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)
IsWhiteSpace(ReadOnlySpan<Char>) IsWhiteSpace(ReadOnlySpan<Char>) IsWhiteSpace(ReadOnlySpan<Char>) IsWhiteSpace(ReadOnlySpan<Char>)
LastIndexOf<T>(ReadOnlySpan<T>, T) LastIndexOf<T>(ReadOnlySpan<T>, T) LastIndexOf<T>(ReadOnlySpan<T>, T) LastIndexOf<T>(ReadOnlySpan<T>, T)
LastIndexOf<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) LastIndexOf<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) LastIndexOf<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) LastIndexOf<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)
LastIndexOfAny<T>(ReadOnlySpan<T>, T, T) LastIndexOfAny<T>(ReadOnlySpan<T>, T, T) LastIndexOfAny<T>(ReadOnlySpan<T>, T, T) LastIndexOfAny<T>(ReadOnlySpan<T>, T, T)
LastIndexOfAny<T>(ReadOnlySpan<T>, T, T, T) LastIndexOfAny<T>(ReadOnlySpan<T>, T, T, T) LastIndexOfAny<T>(ReadOnlySpan<T>, T, T, T) LastIndexOfAny<T>(ReadOnlySpan<T>, T, T, T)
LastIndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) LastIndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) LastIndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) LastIndexOfAny<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)
Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)
Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, Int32) Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, Int32) Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, Int32) Overlaps<T>(ReadOnlySpan<T>, ReadOnlySpan<T>, Int32)
SequenceCompareTo<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) SequenceCompareTo<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) SequenceCompareTo<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) SequenceCompareTo<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)
SequenceEqual<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) SequenceEqual<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) SequenceEqual<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) SequenceEqual<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)
StartsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) StartsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) StartsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison) StartsWith(ReadOnlySpan<Char>, ReadOnlySpan<Char>, StringComparison)
StartsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) StartsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) StartsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>) StartsWith<T>(ReadOnlySpan<T>, ReadOnlySpan<T>)
ToLower(ReadOnlySpan<Char>, Span<Char>, CultureInfo) ToLower(ReadOnlySpan<Char>, Span<Char>, CultureInfo) ToLower(ReadOnlySpan<Char>, Span<Char>, CultureInfo) ToLower(ReadOnlySpan<Char>, Span<Char>, CultureInfo)
ToLowerInvariant(ReadOnlySpan<Char>, Span<Char>) ToLowerInvariant(ReadOnlySpan<Char>, Span<Char>) ToLowerInvariant(ReadOnlySpan<Char>, Span<Char>) ToLowerInvariant(ReadOnlySpan<Char>, Span<Char>)
ToUpper(ReadOnlySpan<Char>, Span<Char>, CultureInfo) ToUpper(ReadOnlySpan<Char>, Span<Char>, CultureInfo) ToUpper(ReadOnlySpan<Char>, Span<Char>, CultureInfo) ToUpper(ReadOnlySpan<Char>, Span<Char>, CultureInfo)
ToUpperInvariant(ReadOnlySpan<Char>, Span<Char>) ToUpperInvariant(ReadOnlySpan<Char>, Span<Char>) ToUpperInvariant(ReadOnlySpan<Char>, Span<Char>) ToUpperInvariant(ReadOnlySpan<Char>, Span<Char>)
Trim(ReadOnlySpan<Char>) Trim(ReadOnlySpan<Char>) Trim(ReadOnlySpan<Char>) Trim(ReadOnlySpan<Char>)
Trim(ReadOnlySpan<Char>, Char) Trim(ReadOnlySpan<Char>, Char) Trim(ReadOnlySpan<Char>, Char) Trim(ReadOnlySpan<Char>, Char)
Trim(ReadOnlySpan<Char>, ReadOnlySpan<Char>) Trim(ReadOnlySpan<Char>, ReadOnlySpan<Char>) Trim(ReadOnlySpan<Char>, ReadOnlySpan<Char>) Trim(ReadOnlySpan<Char>, ReadOnlySpan<Char>)
TrimEnd(ReadOnlySpan<Char>) TrimEnd(ReadOnlySpan<Char>) TrimEnd(ReadOnlySpan<Char>) TrimEnd(ReadOnlySpan<Char>)
TrimEnd(ReadOnlySpan<Char>, Char) TrimEnd(ReadOnlySpan<Char>, Char) TrimEnd(ReadOnlySpan<Char>, Char) TrimEnd(ReadOnlySpan<Char>, Char)
TrimEnd(ReadOnlySpan<Char>, ReadOnlySpan<Char>) TrimEnd(ReadOnlySpan<Char>, ReadOnlySpan<Char>) TrimEnd(ReadOnlySpan<Char>, ReadOnlySpan<Char>) TrimEnd(ReadOnlySpan<Char>, ReadOnlySpan<Char>)
TrimStart(ReadOnlySpan<Char>) TrimStart(ReadOnlySpan<Char>) TrimStart(ReadOnlySpan<Char>) TrimStart(ReadOnlySpan<Char>)
TrimStart(ReadOnlySpan<Char>, Char) TrimStart(ReadOnlySpan<Char>, Char) TrimStart(ReadOnlySpan<Char>, Char) TrimStart(ReadOnlySpan<Char>, Char)
TrimStart(ReadOnlySpan<Char>, ReadOnlySpan<Char>) TrimStart(ReadOnlySpan<Char>, ReadOnlySpan<Char>) TrimStart(ReadOnlySpan<Char>, ReadOnlySpan<Char>) TrimStart(ReadOnlySpan<Char>, ReadOnlySpan<Char>)

적용 대상