Conversions.ToString Método

Definição

Converte o objeto especificado num String valor.

Sobrecargas

Name Description
ToString(Int64)

Converte um Long valor num String valor.

ToString(Single, NumberFormatInfo)

Converte um Single valor num String valor, usando o formato numérico especificado.

ToString(Double, NumberFormatInfo)

Converte um Double valor num String valor, usando o formato numérico especificado.

ToString(Decimal, NumberFormatInfo)

Converte um Decimal valor num String valor, usando o formato numérico especificado.

ToString(UInt64)

Converte um Ulong valor num String valor.

ToString(UInt32)

Converte um uint valor num String valor.

ToString(Single)

Converte um Single valor (um número de ponto flutuante de precisão simples) num String valor.

ToString(Object)

Converte um objeto num String valor.

ToString(Int32)

Converte um valor inteiro num String valor.

ToString(Int16)

Converte um Short valor num String valor.

ToString(Double)

Converte um Double valor num String valor.

ToString(Decimal)

Converte um Decimal valor num String valor.

ToString(DateTime)

Converte um DateTime valor num String valor.

ToString(Char)

Converte um Char valor para um String.

ToString(Byte)

Converte um Byte valor para um String.

ToString(Boolean)

Converte um Boolean valor para um String.

ToString(Int64)

Converte um Long valor num String valor.

public:
 static System::String ^ ToString(long Value);
public static string ToString(long Value);
static member ToString : int64 -> string
Public Shared Function ToString (Value As Long) As String

Parâmetros

Value
Int64

O Long valor a converter.

Devoluções

A String representação do Long valor.

Aplica-se a

ToString(Single, NumberFormatInfo)

Converte um Single valor num String valor, usando o formato numérico especificado.

public:
 static System::String ^ ToString(float Value, System::Globalization::NumberFormatInfo ^ NumberFormat);
public static string ToString(float Value, System.Globalization.NumberFormatInfo NumberFormat);
static member ToString : single * System.Globalization.NumberFormatInfo -> string
Public Shared Function ToString (Value As Single, NumberFormat As NumberFormatInfo) As String

Parâmetros

Value
Single

O Single valor a converter.

NumberFormat
NumberFormatInfo

O formato numérico a usar, de acordo com NumberFormatInfo.

Devoluções

A representação da cadeia do Single valor.

Aplica-se a

ToString(Double, NumberFormatInfo)

Converte um Double valor num String valor, usando o formato numérico especificado.

public:
 static System::String ^ ToString(double Value, System::Globalization::NumberFormatInfo ^ NumberFormat);
public static string ToString(double Value, System.Globalization.NumberFormatInfo NumberFormat);
static member ToString : double * System.Globalization.NumberFormatInfo -> string
Public Shared Function ToString (Value As Double, NumberFormat As NumberFormatInfo) As String

Parâmetros

Value
Double

O Double valor a converter.

NumberFormat
NumberFormatInfo

O formato numérico a usar, de acordo com NumberFormatInfo.

Devoluções

A representação da cadeia do Double valor.

Aplica-se a

ToString(Decimal, NumberFormatInfo)

Converte um Decimal valor num String valor, usando o formato numérico especificado.

public:
 static System::String ^ ToString(System::Decimal Value, System::Globalization::NumberFormatInfo ^ NumberFormat);
public static string ToString(decimal Value, System.Globalization.NumberFormatInfo NumberFormat);
static member ToString : decimal * System.Globalization.NumberFormatInfo -> string
Public Shared Function ToString (Value As Decimal, NumberFormat As NumberFormatInfo) As String

Parâmetros

Value
Decimal

O decimal valor a converter.

NumberFormat
NumberFormatInfo

O formato numérico a usar, de acordo com NumberFormatInfo.

Devoluções

A String representação do Decimal valor.

Aplica-se a

ToString(UInt64)

Importante

Esta API não está em conformidade com CLS.

Alternativa em conformidade com CLS
Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Int64)

Converte um Ulong valor num String valor.

public:
 static System::String ^ ToString(System::UInt64 Value);
[System.CLSCompliant(false)]
public static string ToString(ulong Value);
[<System.CLSCompliant(false)>]
static member ToString : uint64 -> string
Public Shared Function ToString (Value As ULong) As String

Parâmetros

Value
UInt64

O Ulong valor a converter.

Devoluções

A String representação do Ulong valor.

Atributos

Aplica-se a

ToString(UInt32)

Importante

Esta API não está em conformidade com CLS.

Alternativa em conformidade com CLS
Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Int32)

Converte um uint valor num String valor.

public:
 static System::String ^ ToString(System::UInt32 Value);
[System.CLSCompliant(false)]
public static string ToString(uint Value);
[<System.CLSCompliant(false)>]
static member ToString : uint32 -> string
Public Shared Function ToString (Value As UInteger) As String

Parâmetros

Value
UInt32

O Uint valor a converter.

Devoluções

A String representação do Uint valor.

Atributos

Aplica-se a

ToString(Single)

Converte um Single valor (um número de ponto flutuante de precisão simples) num String valor.

public:
 static System::String ^ ToString(float Value);
public static string ToString(float Value);
static member ToString : single -> string
Public Shared Function ToString (Value As Single) As String

Parâmetros

Value
Single

O Single valor a converter.

Devoluções

A representação da cadeia do Single valor.

Aplica-se a

ToString(Object)

Converte um objeto num String valor.

public:
 static System::String ^ ToString(System::Object ^ Value);
public static string ToString(object Value);
static member ToString : obj -> string
Public Shared Function ToString (Value As Object) As String

Parâmetros

Value
Object

O objetivo a converter.

Devoluções

A String representação do objeto.

Aplica-se a

ToString(Int32)

Converte um valor inteiro num String valor.

public:
 static System::String ^ ToString(int Value);
public static string ToString(int Value);
static member ToString : int -> string
Public Shared Function ToString (Value As Integer) As String

Parâmetros

Value
Int32

O int valor a converter.

Devoluções

A String representação do int valor.

Aplica-se a

ToString(Int16)

Converte um Short valor num String valor.

public:
 static System::String ^ ToString(short Value);
public static string ToString(short Value);
static member ToString : int16 -> string
Public Shared Function ToString (Value As Short) As String

Parâmetros

Value
Int16

O Short valor a converter.

Devoluções

A String representação do Short valor.

Aplica-se a

ToString(Double)

Converte um Double valor num String valor.

public:
 static System::String ^ ToString(double Value);
public static string ToString(double Value);
static member ToString : double -> string
Public Shared Function ToString (Value As Double) As String

Parâmetros

Value
Double

O Double valor a converter.

Devoluções

A representação da cadeia do Double valor.

Aplica-se a

ToString(Decimal)

Converte um Decimal valor num String valor.

public:
 static System::String ^ ToString(System::Decimal Value);
public static string ToString(decimal Value);
static member ToString : decimal -> string
Public Shared Function ToString (Value As Decimal) As String

Parâmetros

Value
Decimal

O Decimal valor a converter.

Devoluções

A String representação do Decimal valor.

Aplica-se a

ToString(DateTime)

Converte um DateTime valor num String valor.

public:
 static System::String ^ ToString(DateTime Value);
public static string ToString(DateTime Value);
static member ToString : DateTime -> string
Public Shared Function ToString (Value As DateTime) As String

Parâmetros

Value
DateTime

O DateTime valor a converter.

Devoluções

A String representação do DateTime valor.

Aplica-se a

ToString(Char)

Converte um Char valor para um String.

public:
 static System::String ^ ToString(char Value);
public static string ToString(char Value);
static member ToString : char -> string
Public Shared Function ToString (Value As Char) As String

Parâmetros

Value
Char

O Char valor a converter.

Devoluções

A String representação do Char valor.

Aplica-se a

ToString(Byte)

Converte um Byte valor para um String.

public:
 static System::String ^ ToString(System::Byte Value);
public static string ToString(byte Value);
static member ToString : byte -> string
Public Shared Function ToString (Value As Byte) As String

Parâmetros

Value
Byte

O Byte valor a converter.

Devoluções

A String representação do Byte valor.

Aplica-se a

ToString(Boolean)

Converte um Boolean valor para um String.

public:
 static System::String ^ ToString(bool Value);
public static string ToString(bool Value);
static member ToString : bool -> string
Public Shared Function ToString (Value As Boolean) As String

Parâmetros

Value
Boolean

O Boolean valor a converter.

Devoluções

A String representação do Boolean valor.

Aplica-se a