閱讀英文

共用方式為


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

定義

嘗試將目前布林執行個體的值格式化為所提供字元範圍。

C#
public bool TryFormat(Span<char> destination, out int charsWritten);

參數

destination
Span<Char>

要在其中寫入此實例值的範圍,其格式為字元範圍。

charsWritten
Int32

當這個方法傳回時,會包含以 寫入 destination 的字元數。

傳回

若格式化成功則為 true,否則為 false

適用於

產品 版本
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1