TextEncoder.FindFirstCharacterToEncodeUtf8(ReadOnlySpan<Byte>) Method

Definition

Finds the first element in a UTF-8 text input buffer that would be escaped by the current encoder instance.

C#
public virtual int FindFirstCharacterToEncodeUtf8(ReadOnlySpan<byte> utf8Text);

Parameters

utf8Text
ReadOnlySpan<Byte>

The UTF-8 text input buffer to search.

Returns

The index of the first element in utf8Text that would be escaped by the current encoder instance, or -1 if no data in utf8Text requires escaping.

Applies to

Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)