閱讀英文 編輯

共用方式為


SequenceReader<T>.TryCopyTo(Span<T>) Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Copies data from the current position to the given destination span if there is enough data to fill it.

C#
public readonly bool TryCopyTo(Span<T> destination);

Parameters

destination
Span<T>

Destination span to copy to.

Returns

true if there is enough data to completely fill the destination span; otherwise, false.

Remarks

This method copies a fixed amount of data out of the sequence if possible. It does not advance the reader. To look ahead for a specific stream of data, use IsNext(ReadOnlySpan<T>, Boolean).

Applies to

產品 版本
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1