NFloat.TryFormat 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
嘗試將目前實例的值格式化為提供的字元範圍。 |
| TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider) |
嘗試將目前實例的值格式化為UTF-8到提供的位元組範圍。 |
TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)
- 來源:
- NFloat.cs
- 來源:
- NFloat.cs
- 來源:
- NFloat.cs
- 來源:
- NFloat.cs
- 來源:
- NFloat.cs
嘗試將目前實例的值格式化為提供的字元範圍。
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default);
abstract member TryFormat : Span<char> * int * ReadOnlySpan<char> * IFormatProvider -> bool
override this.TryFormat : Span<char> * int * ReadOnlySpan<char> * IFormatProvider -> bool
Public Function TryFormat (destination As Span(Of Char), ByRef charsWritten As Integer, Optional format As ReadOnlySpan(Of Char) = Nothing, Optional provider As IFormatProvider = Nothing) As Boolean
參數
- charsWritten
- Int32
當此方法回傳時,包含在 中寫 destination入的字元數。
- format
- ReadOnlySpan<Char>
一個包含代表標準或自訂格式字串的字元的區間,該字串定義了 的 destination可接受格式。
- provider
- IFormatProvider
一個可選物件,提供針對 的文化特定格式資訊。destination
傳回
true如果格式化成功;否則,。 false
實作
適用於
TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>, IFormatProvider)
- 來源:
- NFloat.cs
- 來源:
- NFloat.cs
- 來源:
- NFloat.cs
- 來源:
- NFloat.cs
嘗試將目前實例的值格式化為UTF-8到提供的位元組範圍。
public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default);
abstract member TryFormat : Span<byte> * int * ReadOnlySpan<char> * IFormatProvider -> bool
override this.TryFormat : Span<byte> * int * ReadOnlySpan<char> * IFormatProvider -> bool
Public Function TryFormat (utf8Destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As ReadOnlySpan(Of Char) = Nothing, Optional provider As IFormatProvider = Nothing) As Boolean
參數
- bytesWritten
- Int32
當此方法回傳時,包含寫入的 utf8Destination位元組數。
- format
- ReadOnlySpan<Char>
一個包含代表標準或自訂格式字串的字元的區間,該字串定義了 的 utf8Destination可接受格式。
- provider
- IFormatProvider
一個可選物件,提供針對 的文化特定格式資訊。utf8Destination
傳回
true如果格式化成功;否則,。 false