System::Text::Unicode::Utf8::IsValid method

Utf8::IsValid method

Returns true if the provided span contains a valid UTF-8 sequence.

static bool System::Text::Unicode::Utf8::IsValid(ReadOnlySpan<uint8_t> buffer)
ParameterTypeDescription
bufferReadOnlySpan<uint8_t>The UTF-8 bytes to validate.

ReturnValue

true if the sequence is valid UTF-8; otherwise, false.

See Also