Guid.TryFormat 方法

定义

重载

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

尝试将当前 GUID 实例格式化为提供的字符范围。

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

Source:
Guid.cs
Source:
Guid.cs
public bool TryFormat (Span<byte> utf8Destination, out int bytesWritten, ReadOnlySpan<char> format = default);
member this.TryFormat : Span<byte> * int * ReadOnlySpan<char> -> bool
Public Function TryFormat (utf8Destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As ReadOnlySpan(Of Char) = Nothing) As Boolean

参数

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

返回

适用于

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

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

尝试将当前 GUID 实例格式化为提供的字符范围。

public bool TryFormat (Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default);
member this.TryFormat : Span<char> * int * ReadOnlySpan<char> -> bool
Public Function TryFormat (destination As Span(Of Char), ByRef charsWritten As Integer, Optional format As ReadOnlySpan(Of Char) = Nothing) As Boolean

参数

destination
Span<Char>

将 GUID 写入为字符范围的跨度。

charsWritten
Int32

此方法返回时,包含写入范围中的字符数。

format
ReadOnlySpan<Char>

一个只读范围,包含表示以下说明符之一的字符,指示解释当前 GUID 实例时要使用的确切格式:“N”、“D”、“B”、“P”或“X”。

返回

如果格式设置操作成功,true;否则 false

适用于