Прочитај на енглеском Уреди

Делите путем


Utf8.TryWrite Method

Definition

Overloads

TryWrite(Span<Byte>, Utf8+TryWriteInterpolatedStringHandler, Int32)

Writes the specified interpolated string to the UTF-8 byte span.

TryWrite(Span<Byte>, IFormatProvider, Utf8+TryWriteInterpolatedStringHandler, Int32)

Writes the specified interpolated string to the UTF-8 byte span.

TryWrite(Span<Byte>, Utf8+TryWriteInterpolatedStringHandler, Int32)

Source:
Utf8.cs
Source:
Utf8.cs

Writes the specified interpolated string to the UTF-8 byte span.

C#
public static bool TryWrite(Span<byte> destination, ref System.Text.Unicode.Utf8.TryWriteInterpolatedStringHandler handler, out int bytesWritten);

Parameters

destination
Span<Byte>

The span to which the interpolated string should be formatted.

handler
Utf8.TryWriteInterpolatedStringHandler

The interpolated string.

bytesWritten
Int32

When this method returns, contains the number of characters written to the span.

Returns

true if the entire interpolated string could be formatted successfully; otherwise, false.

Applies to

.NET 10 и друге верзије
Производ Верзије
.NET 8, 9, 10

TryWrite(Span<Byte>, IFormatProvider, Utf8+TryWriteInterpolatedStringHandler, Int32)

Source:
Utf8.cs
Source:
Utf8.cs

Writes the specified interpolated string to the UTF-8 byte span.

C#
public static bool TryWrite(Span<byte> destination, IFormatProvider? provider, ref System.Text.Unicode.Utf8.TryWriteInterpolatedStringHandler handler, out int bytesWritten);

Parameters

destination
Span<Byte>

The span to which the interpolated string should be formatted.

provider
IFormatProvider

An object that supplies culture-specific formatting information.

handler
Utf8.TryWriteInterpolatedStringHandler

The interpolated string.

bytesWritten
Int32

When this method returns, contains the number of characters written to the span.

Returns

true if the entire interpolated string could be formatted successfully; otherwise, false.

Applies to

.NET 10 и друге верзије
Производ Верзије
.NET 8, 9, 10