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)

Source:
Utf8.cs
Source:
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)

Source:
Utf8.cs
Source:
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

适用于