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 構造体をスタックに割り当てられているし、マネージ ヒープにエスケープすることはありません。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.

AReadOnlySpan<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)

指定されたメモリ アドレスで始まる指定された T 要素数から新しい ReadOnlySpan<T> を作成します。Creates a new ReadOnlySpan<T> from a specified number of T elements 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 をスローします。Throws a NotSupportedException.

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

この ReadOnlySpan<T> の列挙子を返します。Returns an enumerator for this ReadOnlySpan<T>.

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

サポートされていません。Not supported. NotSupportedException をスローします。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>)

2 つの 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>)

2 つの 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>)

適用対象