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
destinationSpan<char>The span in which to write this instance's value formatted as a span of characters.
charsWrittenintWhen this method returns, contains the number of characters that were written in
destination.formatReadOnlySpan<char>A span containing the characters that represent a standard or custom format string that defines the acceptable format for
destination.providerIFormatProviderAn 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
utf8DestinationSpan<byte>The span in which to write this instance's value formatted as a span of bytes.
bytesWrittenintWhen this method returns, contains the number of bytes that were written in
utf8Destination.formatReadOnlySpan<char>A span containing the characters that represent a standard or custom format string that defines the acceptable format for
utf8Destination.providerIFormatProviderAn optional object that supplies culture-specific formatting information for
utf8Destination.