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)
- 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
参数
内插字符串。
- 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
参数
- provider
- IFormatProvider
一个提供区域性特定的格式设置信息的对象。
内插字符串。
- bytesWritten
- Int32
此方法返回时,包含写入范围中的字符数。
返回
true
如果可以成功设置整个内插字符串的格式,则为 ;否则为 false
。