Conversions.ToString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Converts the specified object to a String value.
Overloads
ToString(Int64) |
Converts a |
ToString(Single, NumberFormatInfo) |
Converts a Single value to a String value, using the specified number format. |
ToString(Double, NumberFormatInfo) |
Converts a Double value to a String value, using the specified number format. |
ToString(Decimal, NumberFormatInfo) |
Converts a Decimal value to a String value, using the specified number format. |
ToString(UInt64) |
Converts a |
ToString(UInt32) |
Converts a |
ToString(Single) |
Converts a Single value (a single-precision floating point number) to a String value. |
ToString(Object) |
Converts an object to a String value. |
ToString(Int32) |
Converts an integer value to a String value. |
ToString(Int16) |
Converts a |
ToString(Double) | |
ToString(Decimal) | |
ToString(DateTime) | |
ToString(Char) | |
ToString(Byte) | |
ToString(Boolean) |
ToString(Int64)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
Converts a Long
value to a String value.
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
Parameters
- Value
- Int64
The Long
value to convert.
Returns
The String
representation of the Long
value.
Applies to
ToString(Single, NumberFormatInfo)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
public:
static System::String ^ ToString(float Value, System::Globalization::NumberFormatInfo ^ NumberFormat);
public static 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
Parameters
- NumberFormat
- NumberFormatInfo
The number format to use, according to NumberFormatInfo.
Returns
The string representation of the Single value.
Applies to
ToString(Double, NumberFormatInfo)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
public:
static System::String ^ ToString(double Value, System::Globalization::NumberFormatInfo ^ NumberFormat);
public static 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
Parameters
- NumberFormat
- NumberFormatInfo
The number format to use, according to NumberFormatInfo.
Returns
The string representation of the Double value.
Applies to
ToString(Decimal, NumberFormatInfo)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
public:
static System::String ^ ToString(System::Decimal Value, System::Globalization::NumberFormatInfo ^ NumberFormat);
public static string ToString (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
Parameters
- Value
- Decimal
The decimal
value to convert.
- NumberFormat
- NumberFormatInfo
The number format to use, according to NumberFormatInfo.
Returns
The String
representation of the Decimal
value.
Applies to
ToString(UInt64)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
Important
This API is not CLS-compliant.
- CLS-compliant alternative
- Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Int64)
Converts a Ulong
value to a String value.
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
Parameters
- Value
- UInt64
The Ulong
value to convert.
Returns
The String
representation of the Ulong
value.
- Attributes
Applies to
ToString(UInt32)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
Important
This API is not CLS-compliant.
- CLS-compliant alternative
- Microsoft.VisualBasic.CompilerServices.Conversions.ToString(Int32)
Converts a uint
value to a String value.
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
Parameters
- Value
- UInt32
The Uint
value to convert.
Returns
The String
representation of the Uint
value.
- Attributes
Applies to
ToString(Single)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
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
Parameters
Returns
The string representation of the Single value.
Applies to
ToString(Object)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
Converts an object to a String value.
public:
static System::String ^ ToString(System::Object ^ Value);
public static string ToString (object Value);
public static string? ToString (object? Value);
static member ToString : obj -> string
Public Shared Function ToString (Value As Object) As String
Parameters
- Value
- Object
The object to convert.
Returns
The String
representation of the object.
Applies to
ToString(Int32)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
Converts an integer value to a String value.
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
Parameters
- Value
- Int32
The int
value to convert.
Returns
The String
representation of the int
value.
Applies to
ToString(Int16)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
Converts a Short
value to a String value.
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
Parameters
- Value
- Int16
The Short
value to convert.
Returns
The String
representation of the Short
value.
Applies to
ToString(Double)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
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
Parameters
Returns
The string representation of the Double value.
Applies to
ToString(Decimal)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
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
Parameters
- Value
- Decimal
The Decimal
value to convert.
Returns
The String
representation of the Decimal
value.
Applies to
ToString(DateTime)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
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
Parameters
- Value
- DateTime
The DateTime
value to convert.
Returns
The String
representation of the DateTime
value.
Applies to
ToString(Char)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
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
Parameters
- Value
- Char
The Char
value to convert.
Returns
The String
representation of the Char
value.
Applies to
ToString(Byte)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
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
Parameters
- Value
- Byte
The Byte
value to convert.
Returns
The String
representation of the Byte
value.
Applies to
ToString(Boolean)
- Source:
- Conversions.vb
- Source:
- Conversions.vb
- Source:
- Conversions.vb
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
Parameters
- Value
- Boolean
The Boolean
value to convert.
Returns
The String
representation of the Boolean
value.