Encode(ReadOnlySpan, Encoding) Method

Definition

Assembly XenoAtom.Logging.dll

Encodes UTF-16 text into bytes using the specified encoding.

public ReadOnlySpan<byte> Encode(ReadOnlySpan<char> text, Encoding encoding)

Parameters

text
ReadOnlySpan<Char>

The text to encode.

encoding
Encoding

The target encoding.

Returns

ReadOnlySpan<Byte>
A span over the encoded bytes.