Boolean.TryFormat(Span<Char>, Int32) 方法

定義

嘗試將目前布林執行個體的值格式化為所提供字元範圍。Tries to format the value of the current boolean instance into the provided span of characters.

public:
 bool TryFormat(Span<char> destination, [Runtime::InteropServices::Out] int % charsWritten);
public bool TryFormat (Span<char> destination, out int charsWritten);
member this.TryFormat : Span<char> * int -> bool
Public Function TryFormat (destination As Span(Of Char), ByRef charsWritten As Integer) As Boolean

參數

destination
Span<Char>

當這個方法傳回時,則為這個執行個體格式化為字元範圍的值。When this method returns, this instance's value formatted as a span of characters.

charsWritten
Int32

當這個方法傳回時,會是寫入 destination 的字元數。When this method returns, the number of characters that were written in destination.

傳回

若格式化成功則為 true,否則為 falsetrue if the formatting was successful; otherwise, false.

適用於