Ascii.FromUtf16(ReadOnlySpan<Char>, Span<Byte>, Int32) 方法

定义

将文本从源缓冲区复制到目标缓冲区,在复制期间从 UTF-16 转换为 ASCII。

public:
 static System::Buffers::OperationStatus FromUtf16(ReadOnlySpan<char> source, Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public static System.Buffers.OperationStatus FromUtf16 (ReadOnlySpan<char> source, Span<byte> destination, out int bytesWritten);
static member FromUtf16 : ReadOnlySpan<char> * Span<byte> * int -> System.Buffers.OperationStatus
Public Shared Function FromUtf16 (source As ReadOnlySpan(Of Char), destination As Span(Of Byte), ByRef bytesWritten As Integer) As OperationStatus

参数

source
ReadOnlySpan<Char>

从中读取 UTF-16 文本的源缓冲区。

destination
Span<Byte>

将 ASCII 文本写入到的目标缓冲区。

bytesWritten
Int32

此方法返回时,包含实际写入 的 destination字节数。 它与实际从 source读取的字符数相同。

返回

描述 OperationStatus 操作结果的 。

适用于