https://learn.microsoft.com/en-us/dotnet/api/system.text.encoding.trygetbytes?view=net-10.0&viewFallbackFrom=net-7.0
Encoding.TryGetBytes(ReadOnlySpanChar, SpanByte, Int32) Method (System.Text) | Microsoft Learn
Encodes into a span of bytes a set of characters from the specified read-only span if the destination is large enough.
encodingmethodsystemtextmicrosoft