Method TryFormat
TryFormat(Span<char>, out int, IFormatProvider?)
Tries to format the value of the current instance into the provided span of characters.
Declaration
public bool TryFormat(Span<char> destination, out int charsWritten, IFormatProvider? provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Span<char> | destination | The span in which to write this instance's value formatted as a span of characters. |
| int | charsWritten | When this method returns, contains the number of characters that were written in |
| IFormatProvider | provider | An optional object that supplies culture-specific formatting information for |
Returns
| Type | Description |
|---|---|
| bool |
TryFormat(Span<char>, out int, ReadOnlySpan<char>, IFormatProvider?)
Tries to format the value of the current instance into the provided span of characters.
Declaration
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Span<char> | destination | The span in which to write this instance's value formatted as a span of characters. |
| int | charsWritten | When this method returns, contains the number of characters that were written in |
| ReadOnlySpan<char> | format | A span containing the characters that represent a standard or custom format string that defines the acceptable format for |
| IFormatProvider | provider | An optional object that supplies culture-specific formatting information for |
Returns
| Type | Description |
|---|---|
| bool |
Implements
TryFormat(Span<byte>, out int, IFormatProvider?)
Tries to format the value of the current instance as UTF-8 into the provided span of bytes.
Declaration
public bool TryFormat(Span<byte> destination, out int bytesWritten, IFormatProvider? provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Span<byte> | destination | |
| int | bytesWritten | When this method returns, contains the number of bytes that were written in |
| IFormatProvider | provider | An optional object that supplies culture-specific formatting information for |
Returns
| Type | Description |
|---|---|
| bool |
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.
Declaration
public bool TryFormat(Span<byte> destination, out int bytesWritten, ReadOnlySpan<char> format, IFormatProvider? provider = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Span<byte> | destination | |
| int | bytesWritten | When this method returns, contains the number of bytes that were written in |
| ReadOnlySpan<char> | format | A span containing the characters that represent a standard or custom format string that defines the acceptable format for |
| IFormatProvider | provider | An optional object that supplies culture-specific formatting information for |
Returns
| Type | Description |
|---|---|
| bool |