EnumTEnumTryFormat(TEnum, SpanByte, Int32, ReadOnlySpanByte) Method
Tries to format the
value of the current
TEnum instance
into the provided span of UTF-8 bytes using
Auto formatting options.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.5.0
public static bool TryFormat(
TEnum value,
Span<byte> utf8Destination,
out int bytesWritten,
ReadOnlySpan<byte> separator
)
Public Shared Function TryFormat (
value As TEnum,
utf8Destination As Span(Of Byte),
<OutAttribute> ByRef bytesWritten As Integer,
separator As ReadOnlySpan(Of Byte)
) As Boolean
public:
static bool TryFormat(
TEnum value,
Span<unsigned char> utf8Destination,
[OutAttribute] int% bytesWritten,
ReadOnlySpan<unsigned char> separator
)
static member TryFormat :
value : 'TEnum *
utf8Destination : Span<byte> *
bytesWritten : int byref *
separator : ReadOnlySpan<byte> -> bool
- value TEnum
- A TEnum value to be formatted.
- utf8Destination SpanByte
- The target span of UTF-8 bytes of the formatted value.
- bytesWritten Int32
- When this method returns, the number of bytes that were written in utf8Destination.
- separator ReadOnlySpanByte
- A span containing the separator in case of flags formatting. If empty, then comma-space (, ) separator is used.
Boolean, if the formatting was successful; otherwise,
.