Utf8Formatter.TryFormat Metodo

Definizione

Overload

Nome Descrizione
TryFormat(Boolean, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto Boolean come stringa UTF8.

TryFormat(Byte, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto Byte come stringa UTF8.

TryFormat(DateTime, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto DateTime come stringa UTF8.

TryFormat(DateTimeOffset, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto DateTimeOffset come stringa UTF8.

TryFormat(Decimal, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto Decimal come stringa UTF8.

TryFormat(Double, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto Double come stringa UTF8.

TryFormat(Guid, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto Guid come stringa UTF8.

TryFormat(Int16, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto Int16 come stringa UTF8.

TryFormat(Int32, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto Int32 come stringa UTF8.

TryFormat(Int64, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto Int64 come stringa UTF8.

TryFormat(SByte, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto SByte come stringa UTF8.

TryFormat(Single, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto Single come stringa UTF8.

TryFormat(TimeSpan, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto TimeSpan come stringa UTF8.

TryFormat(UInt16, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto UInt16 come stringa UTF8.

TryFormat(UInt32, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto UInt32 come stringa UTF8.

TryFormat(UInt64, Span<Byte>, Int32, StandardFormat)

Formatta un oggetto UInt64 come stringa UTF8.

TryFormat(Boolean, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Boolean.cs
Origine:
Utf8Formatter.Boolean.cs
Origine:
Utf8Formatter.Boolean.cs
Origine:
Utf8Formatter.Boolean.cs
Origine:
Utf8Formatter.Boolean.cs

Formatta un oggetto Boolean come stringa UTF8.

public static bool TryFormat(bool value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : bool * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As Boolean, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
Boolean

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio
G (impostazione predefinita) Vero/Falso
l true/false

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(Byte, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs

Formatta un oggetto Byte come stringa UTF8.

public static bool TryFormat(byte value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : byte * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As Byte, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
Byte

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio
G/g (impostazione predefinita)
D/d 122
N/n 122
X/x 7a

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(DateTime, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Date.cs
Origine:
Utf8Formatter.Date.cs
Origine:
Utf8Formatter.Date.cs
Origine:
Utf8Formatter.Date.cs
Origine:
Utf8Formatter.Date.cs

Formatta un oggetto DateTime come stringa UTF8.

public static bool TryFormat(DateTime value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : DateTime * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As DateTime, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
DateTime

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio Comments
G (impostazione predefinita) 05/25/2017 10:30:15
R Mar, 03 Gennaio 2017 08:08:05 GMT (RFC 1123)
l tue, 03 gennaio 2017 08:08:05 gmt (RFC minuscolo 1123)
o 2017-06-12T05:30:45.7680000-07:00 (Round trippable)

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(DateTimeOffset, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Date.cs
Origine:
Utf8Formatter.Date.cs
Origine:
Utf8Formatter.Date.cs
Origine:
Utf8Formatter.Date.cs
Origine:
Utf8Formatter.Date.cs

Formatta un oggetto DateTimeOffset come stringa UTF8.

public static bool TryFormat(DateTimeOffset value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : DateTimeOffset * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As DateTimeOffset, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
DateTimeOffset

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Si applica a

TryFormat(Decimal, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Decimal.cs
Origine:
Utf8Formatter.Decimal.cs
Origine:
Utf8Formatter.Decimal.cs
Origine:
Utf8Formatter.Decimal.cs
Origine:
Utf8Formatter.Decimal.cs

Formatta un oggetto Decimal come stringa UTF8.

public static bool TryFormat(decimal value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : decimal * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As Decimal, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
Decimal

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio Comments
G/g (impostazione predefinita)
F/f 12.45 Punto fisso
E/e 1.245000e1 Esponenziale

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(Double, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Float.cs
Origine:
Utf8Formatter.Float.cs
Origine:
Utf8Formatter.Float.cs
Origine:
Utf8Formatter.Float.cs
Origine:
Utf8Formatter.Float.cs

Formatta un oggetto Double come stringa UTF8.

public static bool TryFormat(double value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : double * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As Double, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
Double

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio Comments
G/g (impostazione predefinita)
F/f 12.45 Punto fisso
E/e 1.245000e1 Esponenziale

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(Guid, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Guid.cs
Origine:
Utf8Formatter.Guid.cs
Origine:
Utf8Formatter.Guid.cs
Origine:
Utf8Formatter.Guid.cs
Origine:
Utf8Formatter.Guid.cs

Formatta un oggetto Guid come stringa UTF8.

public static bool TryFormat(Guid value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : Guid * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As Guid, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
Guid

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Commenti

Formati supportati:

Stringa di formato Stringa di risultato
D (impostazione predefinita) nnnnnnnn-nnnn-nnnn-nnnn-nnnnnn
B {nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnn}
P (nnnnnnnn-nnnn-nnnn-nnnn-nnnnnnnnnnnn)
N nnnnnn

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(Int16, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs

Formatta un oggetto Int16 come stringa UTF8.

public static bool TryFormat(short value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : int16 * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As Short, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
Int16

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio
G/g (impostazione predefinita)
D/d 32767
N/n 32,767
X/x 7fff

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(Int32, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs

Formatta un oggetto Int32 come stringa UTF8.

public static bool TryFormat(int value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : int * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As Integer, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
Int32

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio
G/g (impostazione predefinita)
D/d 32767
N/n 32,767
X/x 7fff

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(Int64, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs

Formatta un oggetto Int64 come stringa UTF8.

public static bool TryFormat(long value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : int64 * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As Long, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
Int64

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio
G/g (impostazione predefinita)
D/d 32767
N/n 32,767
X/x 7fff

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(SByte, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs

Importante

Questa API non è conforme a CLS.

Formatta un oggetto SByte come stringa UTF8.

[System.CLSCompliant(false)]
public static bool TryFormat(sbyte value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
[<System.CLSCompliant(false)>]
static member TryFormat : sbyte * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As SByte, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
SByte

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Attributi

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio
G/g (impostazione predefinita)
D/d 122
N/n 122
X/x 7a

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(Single, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Float.cs
Origine:
Utf8Formatter.Float.cs
Origine:
Utf8Formatter.Float.cs
Origine:
Utf8Formatter.Float.cs
Origine:
Utf8Formatter.Float.cs

Formatta un oggetto Single come stringa UTF8.

public static bool TryFormat(float value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : single * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As Single, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
Single

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio Comments
G/g (impostazione predefinita)
F/f 12.45 Punto fisso
E/e 1.245000e1 Esponenziale

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(TimeSpan, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.TimeSpan.cs
Origine:
Utf8Formatter.TimeSpan.cs
Origine:
Utf8Formatter.TimeSpan.cs
Origine:
Utf8Formatter.TimeSpan.cs
Origine:
Utf8Formatter.TimeSpan.cs

Formatta un oggetto TimeSpan come stringa UTF8.

public static bool TryFormat(TimeSpan value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
static member TryFormat : TimeSpan * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As TimeSpan, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
TimeSpan

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Commenti

Formati supportati:

Stringa di formato Stringa di risultato Comments
c/t/T (impostazione predefinita) [-][d.]hh:mm:ss[.fffffff] (formato costante)
G ^d:hh:mm:ss.fffffffff (lungo generale)
g [-][d:][h]h:mm:ss[.f[f[f[f[f[f[f]]]]]] (breve generale)

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(UInt16, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs

Importante

Questa API non è conforme a CLS.

Formatta un oggetto UInt16 come stringa UTF8.

[System.CLSCompliant(false)]
public static bool TryFormat(ushort value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
[<System.CLSCompliant(false)>]
static member TryFormat : uint16 * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As UShort, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
UInt16

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Attributi

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio
G/g (impostazione predefinita)
D/d 32767
N/n 32,767
X/x 7fff

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(UInt32, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs

Importante

Questa API non è conforme a CLS.

Formatta un oggetto UInt32 come stringa UTF8.

[System.CLSCompliant(false)]
public static bool TryFormat(uint value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
[<System.CLSCompliant(false)>]
static member TryFormat : uint32 * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As UInteger, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
UInt32

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Attributi

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio
G/g (impostazione predefinita)
D/d 32767
N/n 32,767
X/x 7fff

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a

TryFormat(UInt64, Span<Byte>, Int32, StandardFormat)

Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs
Origine:
Utf8Formatter.Integer.cs

Importante

Questa API non è conforme a CLS.

Formatta un oggetto UInt64 come stringa UTF8.

[System.CLSCompliant(false)]
public static bool TryFormat(ulong value, Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default);
[<System.CLSCompliant(false)>]
static member TryFormat : uint64 * Span<byte> * int * System.Buffers.StandardFormat -> bool
Public Shared Function TryFormat (value As ULong, destination As Span(Of Byte), ByRef bytesWritten As Integer, Optional format As StandardFormat = Nothing) As Boolean

Parametri

value
UInt64

Valore da formattare.

destination
Span<Byte>

Buffer in cui scrivere il valore formattato UTF8.

bytesWritten
Int32

Quando termina, il metodo contiene la lunghezza del testo formattato in byte.

format
StandardFormat

Formato standard da usare.

Valori restituiti

true se l'operazione di formattazione ha esito positivo; false se destination è troppo piccolo.

Attributi

Commenti

Formati supportati:

Stringa di formato Stringa di risultati di esempio
G/g (impostazione predefinita)
D/d 32767
N/n 32,767
X/x 7fff

Se il metodo ha esito negativo, aumentare in modo iterativo le dimensioni del buffer e riprovare fino a quando non riesce.

Si applica a