EnumTEnumTryFormat(TEnum, SpanChar, Int32, ReadOnlySpanChar) Method
Tries to format the
value of the current
TEnum instance
into the provided span of characters using
Auto formatting options.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0-preview.1
public static bool TryFormat(
TEnum value,
Span<char> destination,
out int charsWritten,
ReadOnlySpan<char> separator
)
Public Shared Function TryFormat (
value As TEnum,
destination As Span(Of Char),
<OutAttribute> ByRef charsWritten As Integer,
separator As ReadOnlySpan(Of Char)
) As Boolean
public:
static bool TryFormat(
TEnum value,
Span<wchar_t> destination,
[OutAttribute] int% charsWritten,
ReadOnlySpan<wchar_t> separator
)
static member TryFormat :
value : 'TEnum *
destination : Span<char> *
charsWritten : int byref *
separator : ReadOnlySpan<char> -> bool
- value TEnum
- A TEnum value to be formatted.
- destination SpanChar
- The target span of characters of the formatted value.
- charsWritten Int32
- When this method returns, the number of characters that were written in destination.
- separator ReadOnlySpanChar
- 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,
.