Method TryFormat
- Namespace
- Zyl.VectorTraits.ExTypes
- Assembly
- VectorTraits.dll
TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)
Tries to format the value of the current instance into the provided span of characters.
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)
Parameters
destination
Span<char>The span in which to write this instance's value formatted as a span of characters.
charsWritten
intWhen this method returns, contains the number of characters that were written in
destination
.format
ReadOnlySpan<char>A span containing the characters that represent a standard or custom format string that defines the acceptable format for
destination
.provider
IFormatProviderAn optional object that supplies culture-specific formatting information for
destination
.
Returns
TryFormat(Span<byte>, out int, ReadOnlySpan<char>, IFormatProvider?)
Tries to format the value of the current instance as UTF-8 into the provided span of bytes.
public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = null)
Parameters
utf8Destination
Span<byte>The span in which to write this instance's value formatted as a span of bytes.
bytesWritten
intWhen this method returns, contains the number of bytes that were written in
utf8Destination
.format
ReadOnlySpan<char>A span containing the characters that represent a standard or custom format string that defines the acceptable format for
utf8Destination
.provider
IFormatProviderAn optional object that supplies culture-specific formatting information for
utf8Destination
.