共用方式為


Utf8.TryWrite 方法

定義

多載

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

參數

destination
Span<Byte>

應該格式化插補字串的範圍。

handler
Utf8.TryWriteInterpolatedStringHandler

插補字串。

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

參數

destination
Span<Byte>

應該格式化插補字串的範圍。

provider
IFormatProvider

物件,提供特定文化特性格式資訊。

handler
Utf8.TryWriteInterpolatedStringHandler

插補字串。

bytesWritten
Int32

當這個方法傳回時,會包含寫入範圍中的字元數。

傳回

true 如果可以成功格式化整個插補字串,則為 ;否則為 false

適用於