SequenceReader<T>.TryReadTo 方法

定义

重载

TryReadTo(ReadOnlySpan<T>, T, T, Boolean)

尝试读取给定 delimiter 之前的所有内容,忽略前面为 delimiterEscape 的分隔符。

TryReadTo(ReadOnlySequence<T>, T, T, Boolean)

尝试读取给定 delimiter 之前的所有内容,忽略前面为 delimiterEscape 的分隔符。

TryReadTo(ReadOnlySpan<T>, T, Boolean)

尝试读取给定 delimiter 之前的所有内容。

TryReadTo(ReadOnlySequence<T>, ReadOnlySpan<T>, Boolean)

尝试读取数据,直到指定为只读范围的整个分隔符匹配。

TryReadTo(ReadOnlySequence<T>, T, Boolean)

尝试读取给定 delimiter 之前的所有内容。

TryReadTo(ReadOnlySpan<T>, ReadOnlySpan<T>, Boolean)

尝试读取给定 delimiter 之前的所有内容。

TryReadTo(ReadOnlySpan<T>, T, T, Boolean)

Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs

尝试读取给定 delimiter 之前的所有内容,忽略前面为 delimiterEscape 的分隔符。

public bool TryReadTo (out ReadOnlySpan<T> span, T delimiter, T delimiterEscape, bool advancePastDelimiter = true);
member this.TryReadTo : ReadOnlySpan * 'T * 'T * bool -> bool
Public Function TryReadTo (ByRef span As ReadOnlySpan(Of T), delimiter As T, delimiterEscape As T, Optional advancePastDelimiter As Boolean = true) As Boolean

参数

span
ReadOnlySpan<T>

当方法返回时,包含读取的数据(如果有)。

delimiter
T

要查找的分隔符。

delimiterEscape
T

一个值,指示将跳过紧跟 delimiter 之后的项。

advancePastDelimiter
Boolean

若要跳过 delimiter(如果已发现),则为 true;否则为 false

返回

如果发现了 delimiter,则为 true;否则为 false

适用于

TryReadTo(ReadOnlySequence<T>, T, T, Boolean)

Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs

尝试读取给定 delimiter 之前的所有内容,忽略前面为 delimiterEscape 的分隔符。

public bool TryReadTo (out System.Buffers.ReadOnlySequence<T> sequence, T delimiter, T delimiterEscape, bool advancePastDelimiter = true);
member this.TryReadTo : ReadOnlySequence * 'T * 'T * bool -> bool
Public Function TryReadTo (ByRef sequence As ReadOnlySequence(Of T), delimiter As T, delimiterEscape As T, Optional advancePastDelimiter As Boolean = true) As Boolean

参数

sequence
ReadOnlySequence<T>

当方法返回时,包含读取的数据(如果有)。

delimiter
T

要查找的分隔符。

delimiterEscape
T

一个值,指示将跳过紧跟 delimiter 之后的项。

advancePastDelimiter
Boolean

若要跳过 delimiter(如果已发现),则为 true;否则为 false

返回

如果发现了 delimiter,则为 true;否则为 false

适用于

TryReadTo(ReadOnlySpan<T>, T, Boolean)

Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs

尝试读取给定 delimiter 之前的所有内容。

public bool TryReadTo (out ReadOnlySpan<T> span, T delimiter, bool advancePastDelimiter = true);
member this.TryReadTo : ReadOnlySpan * 'T * bool -> bool
Public Function TryReadTo (ByRef span As ReadOnlySpan(Of T), delimiter As T, Optional advancePastDelimiter As Boolean = true) As Boolean

参数

span
ReadOnlySpan<T>

当方法返回时,包含读取的数据(如果有)。

delimiter
T

要查找的分隔符。

advancePastDelimiter
Boolean

若要跳过 delimiter(如果已发现),则为 true;否则为 false

返回

如果发现了 delimiter,则为 true;否则为 false

适用于

TryReadTo(ReadOnlySequence<T>, ReadOnlySpan<T>, Boolean)

Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs

尝试读取数据,直到指定为只读范围的整个分隔符匹配。

public bool TryReadTo (out System.Buffers.ReadOnlySequence<T> sequence, ReadOnlySpan<T> delimiter, bool advancePastDelimiter = true);
public bool TryReadTo (out System.Buffers.ReadOnlySequence<T> sequence, scoped ReadOnlySpan<T> delimiter, bool advancePastDelimiter = true);
member this.TryReadTo : ReadOnlySequence * ReadOnlySpan<'T (requires 'T : struct)> * bool -> bool
Public Function TryReadTo (ByRef sequence As ReadOnlySequence(Of T), delimiter As ReadOnlySpan(Of T), Optional advancePastDelimiter As Boolean = true) As Boolean

参数

sequence
ReadOnlySequence<T>

当方法返回时,包含读取的数据(如果有)。

delimiter
ReadOnlySpan<T>

一个只读范围,包含一个或多个分隔符。

advancePastDelimiter
Boolean

若要跳过 delimiter(如果已发现),则为 true;否则为 false

返回

如果发现了 delimiter,则为 true;否则为 false

适用于

TryReadTo(ReadOnlySequence<T>, T, Boolean)

Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs

尝试读取给定 delimiter 之前的所有内容。

public bool TryReadTo (out System.Buffers.ReadOnlySequence<T> sequence, T delimiter, bool advancePastDelimiter = true);
member this.TryReadTo : ReadOnlySequence * 'T * bool -> bool
Public Function TryReadTo (ByRef sequence As ReadOnlySequence(Of T), delimiter As T, Optional advancePastDelimiter As Boolean = true) As Boolean

参数

sequence
ReadOnlySequence<T>

当方法返回时,包含读取的数据(如果有)。

delimiter
T

要查找的分隔符。

advancePastDelimiter
Boolean

若要跳过 delimiter(如果已发现),则为 true;否则为 false

返回

如果发现了 delimiter,则为 true;否则为 false

适用于

TryReadTo(ReadOnlySpan<T>, ReadOnlySpan<T>, Boolean)

Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs
Source:
SequenceReader.Search.cs

尝试读取给定 delimiter 之前的所有内容。

public bool TryReadTo (out ReadOnlySpan<T> span, ReadOnlySpan<T> delimiter, bool advancePastDelimiter = true);
public bool TryReadTo (out ReadOnlySpan<T> span, scoped ReadOnlySpan<T> delimiter, bool advancePastDelimiter = true);
member this.TryReadTo : ReadOnlySpan * ReadOnlySpan<'T (requires 'T : struct)> * bool -> bool
Public Function TryReadTo (ByRef span As ReadOnlySpan(Of T), delimiter As ReadOnlySpan(Of T), Optional advancePastDelimiter As Boolean = true) As Boolean

参数

span
ReadOnlySpan<T>

读取数据(若有)。

delimiter
ReadOnlySpan<T>

要查找的分隔符。

advancePastDelimiter
Boolean

若要越过 delimiter(如果找到),则为 true

返回

如果发现了 delimiter,则为 true;否则为 false

适用于