Utf8.TryWrite 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
TryWrite(Span<Byte>, Utf8+TryWriteInterpolatedStringHandler, Int32) |
將指定的插補字串寫入 UTF-8 位元組範圍。 |
TryWrite(Span<Byte>, IFormatProvider, Utf8+TryWriteInterpolatedStringHandler, Int32) |
將指定的插補字串寫入 UTF-8 位元組範圍。 |
TryWrite(Span<Byte>, Utf8+TryWriteInterpolatedStringHandler, Int32)
- 來源:
- Utf8.cs
- 來源:
- Utf8.cs
將指定的插補字串寫入 UTF-8 位元組範圍。
public:
static bool TryWrite(Span<System::Byte> destination, System::Text::Unicode::Utf8::TryWriteInterpolatedStringHandler % handler, [Runtime::InteropServices::Out] int % bytesWritten);
public static bool TryWrite (Span<byte> destination, ref System.Text.Unicode.Utf8.TryWriteInterpolatedStringHandler handler, out int bytesWritten);
static member TryWrite : Span<byte> * TryWriteInterpolatedStringHandler * int -> bool
Public Shared Function TryWrite (destination As Span(Of Byte), ByRef handler As Utf8.TryWriteInterpolatedStringHandler, ByRef bytesWritten As Integer) As Boolean
參數
插補字串。
- bytesWritten
- Int32
當這個方法傳回時,會包含寫入範圍中的字元數。
傳回
true
如果可以成功格式化整個插補字串,則為 ;否則為 false
。
適用於
TryWrite(Span<Byte>, IFormatProvider, Utf8+TryWriteInterpolatedStringHandler, Int32)
- 來源:
- Utf8.cs
- 來源:
- Utf8.cs
將指定的插補字串寫入 UTF-8 位元組範圍。
public:
static bool TryWrite(Span<System::Byte> destination, IFormatProvider ^ provider, System::Text::Unicode::Utf8::TryWriteInterpolatedStringHandler % handler, [Runtime::InteropServices::Out] int % bytesWritten);
public static bool TryWrite (Span<byte> destination, IFormatProvider? provider, ref System.Text.Unicode.Utf8.TryWriteInterpolatedStringHandler handler, out int bytesWritten);
static member TryWrite : Span<byte> * IFormatProvider * TryWriteInterpolatedStringHandler * int -> bool
Public Shared Function TryWrite (destination As Span(Of Byte), provider As IFormatProvider, ByRef handler As Utf8.TryWriteInterpolatedStringHandler, ByRef bytesWritten As Integer) As Boolean
參數
- provider
- IFormatProvider
物件,提供特定文化特性格式資訊。
插補字串。
- bytesWritten
- Int32
當這個方法傳回時,會包含寫入範圍中的字元數。
傳回
true
如果可以成功格式化整個插補字串,則為 ;否則為 false
。