Delen via


StringSegment.AsSpan Method

Definition

Overloads

AsSpan()

Gets a ReadOnlySpan<T> from the current StringSegment.

AsSpan(Int32)

Gets a ReadOnlySpan<T> from the current StringSegment that starts at the position specified by start, and has the remaining length.

AsSpan(Int32, Int32)

Gets a ReadOnlySpan<T> from the current StringSegment that starts at the position specified by start, and has the specified length.

AsSpan()

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Gets a ReadOnlySpan<T> from the current StringSegment.

public:
 ReadOnlySpan<char> AsSpan();
public ReadOnlySpan<char> AsSpan ();
member this.AsSpan : unit -> ReadOnlySpan<char>
Public Function AsSpan () As ReadOnlySpan(Of Char)

Returns

The ReadOnlySpan<T> from this StringSegment.

Applies to

AsSpan(Int32)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Gets a ReadOnlySpan<T> from the current StringSegment that starts at the position specified by start, and has the remaining length.

public:
 ReadOnlySpan<char> AsSpan(int start);
public ReadOnlySpan<char> AsSpan (int start);
member this.AsSpan : int -> ReadOnlySpan<char>
Public Function AsSpan (start As Integer) As ReadOnlySpan(Of Char)

Parameters

start
Int32

The zero-based starting character position in this StringSegment.

Returns

A ReadOnlySpan<T> with the remaining chars that begins at start in this StringSegment.

Exceptions

start is greater than or equal to Length or less than zero.

Applies to

AsSpan(Int32, Int32)

Source:
StringSegment.cs
Source:
StringSegment.cs
Source:
StringSegment.cs

Gets a ReadOnlySpan<T> from the current StringSegment that starts at the position specified by start, and has the specified length.

public:
 ReadOnlySpan<char> AsSpan(int start, int length);
public ReadOnlySpan<char> AsSpan (int start, int length);
member this.AsSpan : int * int -> ReadOnlySpan<char>
Public Function AsSpan (start As Integer, length As Integer) As ReadOnlySpan(Of Char)

Parameters

start
Int32

The zero-based starting character position in this StringSegment.

length
Int32

The number of characters in the span.

Returns

A ReadOnlySpan<T> with length that begins at start in this StringSegment.

Exceptions

start or length is less than zero, or start + length is greater than Length.

Applies to