Guid.TryFormat Method

Definition

Overloads

TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>)
TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>)

Tries to format the current GUID instance into the provided character span.

TryFormat(Span<Byte>, Int32, ReadOnlySpan<Char>)

Source:
Guid.cs
Source:
Guid.cs
C#
public bool TryFormat(Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format = default);

Parameters

utf8Destination
Span<Byte>
bytesWritten
Int32
format
ReadOnlySpan<Char>

Returns

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET 8, 9, 10

TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>)

Source:
Guid.cs
Source:
Guid.cs
Source:
Guid.cs

Tries to format the current GUID instance into the provided character span.

C#
public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default);

Parameters

destination
Span<Char>

The span in which to write the GUID as a span of characters.

charsWritten
Int32

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

format
ReadOnlySpan<Char>

A read-only span containing the character representing one of the following specifiers that indicates the exact format to use when interpreting the current GUID instance: "N", "D", "B", "P", or "X".

Returns

true if the formatting operation was successful; false otherwise.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.1