Version.TryFormat 方法
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
TryFormat(Span<Char>, Int32, Int32) |
嘗試將此版本執行個體格式化為字元延伸。 |
TryFormat(Span<Byte>, Int32, Int32) |
嘗試將此版本實例格式化為位元組範圍。 |
TryFormat(Span<Char>, Int32) |
嘗試將此版本執行個體格式化為字元延伸。 |
TryFormat(Span<Byte>, Int32) |
嘗試將此版本實例格式化為位元組範圍。 |
- 來源:
- Version.cs
- 來源:
- Version.cs
- 來源:
- Version.cs
嘗試將此版本執行個體格式化為字元延伸。
public:
bool TryFormat(Span<char> destination, int fieldCount, [Runtime::InteropServices::Out] int % charsWritten);
C#
public bool TryFormat(Span<char> destination, int fieldCount, out int charsWritten);
member this.TryFormat : Span<char> * int * int -> bool
Public Function TryFormat (destination As Span(Of Char), fieldCount As Integer, ByRef charsWritten As Integer) As Boolean
參數
- fieldCount
- Int32
要傳回的元件數目。 值的範圍介於 0 到 4 之間。
- charsWritten
- Int32
當這個方法傳回時,會包含以 寫入 destination
的字元數。
傳回
若格式化成功則為 true
,否則為 false
。
適用於
.NET 10 和其他版本
產品 | 版本 |
---|---|
.NET | Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Standard | 2.1 |
- 來源:
- Version.cs
- 來源:
- Version.cs
嘗試將此版本實例格式化為位元組範圍。
public:
bool TryFormat(Span<System::Byte> utf8Destination, int fieldCount, [Runtime::InteropServices::Out] int % bytesWritten);
C#
public bool TryFormat(Span<byte> utf8Destination, int fieldCount, out int bytesWritten);
member this.TryFormat : Span<byte> * int * int -> bool
Public Function TryFormat (utf8Destination As Span(Of Byte), fieldCount As Integer, ByRef bytesWritten As Integer) As Boolean
參數
- fieldCount
- Int32
要傳回的元件數目。 值的範圍介於 0 到 4 之間。
- bytesWritten
- Int32
當這個方法傳回時,包含以 寫入 utf8Destination
的位元組數目。
傳回
若格式化成功則為 true
,否則為 false
。
適用於
.NET 10 和其他版本
產品 | 版本 |
---|---|
.NET | 8, 9, 10 |
- 來源:
- Version.cs
- 來源:
- Version.cs
- 來源:
- Version.cs
嘗試將此版本執行個體格式化為字元延伸。
public:
bool TryFormat(Span<char> destination, [Runtime::InteropServices::Out] int % charsWritten);
C#
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
參數
- charsWritten
- Int32
當這個方法傳回時,會包含以 寫入 destination
的字元數。
傳回
若格式化成功則為 true
,否則為 false
。
適用於
.NET 10 和其他版本
產品 | 版本 |
---|---|
.NET | Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Standard | 2.1 |
- 來源:
- Version.cs
- 來源:
- Version.cs
嘗試將此版本實例格式化為位元組範圍。
public:
bool TryFormat(Span<System::Byte> utf8Destination, [Runtime::InteropServices::Out] int % bytesWritten);
C#
public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten);
member this.TryFormat : Span<byte> * int -> bool
Public Function TryFormat (utf8Destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean
參數
- bytesWritten
- Int32
當這個方法傳回時,包含以 寫入 utf8Destination
的位元組數目。
傳回
若格式化成功則為 true
,否則為 false
。
適用於
.NET 10 和其他版本
產品 | 版本 |
---|---|
.NET | 8, 9, 10 |