Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

interface System.​IConvertible

Assembly: System.Runtime

Defines methods that convert the value of the implementing reference or value type to a common language runtime type that has an equivalent value.

Methods

GetTypeCode​()
Returns the <see cref="T:System.TypeCode" /> for this instance.
Returns The enumerated constant that is the <see cref="T:System.TypeCode" /> of the class or value type that implements this interface.
bool
ToBoolean​(IFormatProvider provider)
Converts the value of this instance to an equivalent Boolean value using the specified culture-specific formatting information.
Returns A Boolean value equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
byte
ToByte​(IFormatProvider provider)
Converts the value of this instance to an equivalent 8-bit unsigned integer using the specified culture-specific formatting information.
Returns An 8-bit unsigned integer equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
char
ToChar​(IFormatProvider provider)
Converts the value of this instance to an equivalent Unicode character using the specified culture-specific formatting information.
Returns A Unicode character equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
ToDateTime​(IFormatProvider provider)
Converts the value of this instance to an equivalent <see cref="T:System.DateTime" /> using the specified culture-specific formatting information.
Returns A <see cref="T:System.DateTime" /> instance equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
decimal
ToDecimal​(IFormatProvider provider)
Converts the value of this instance to an equivalent <see cref="T:System.Decimal" /> number using the specified culture-specific formatting information.
Returns A <see cref="T:System.Decimal" /> number equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
double
ToDouble​(IFormatProvider provider)
Converts the value of this instance to an equivalent double-precision floating-point number using the specified culture-specific formatting information.
Returns A double-precision floating-point number equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
short
ToInt16​(IFormatProvider provider)
Converts the value of this instance to an equivalent 16-bit signed integer using the specified culture-specific formatting information.
Returns An 16-bit signed integer equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
int
ToInt32​(IFormatProvider provider)
Converts the value of this instance to an equivalent 32-bit signed integer using the specified culture-specific formatting information.
Returns An 32-bit signed integer equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
long
ToInt64​(IFormatProvider provider)
Converts the value of this instance to an equivalent 64-bit signed integer using the specified culture-specific formatting information.
Returns An 64-bit signed integer equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
sbyte
ToSByte​(IFormatProvider provider)
Converts the value of this instance to an equivalent 8-bit signed integer using the specified culture-specific formatting information.
Returns An 8-bit signed integer equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
ToSingle​(IFormatProvider provider)
Converts the value of this instance to an equivalent single-precision floating-point number using the specified culture-specific formatting information.
Returns A single-precision floating-point number equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
string
ToString​(IFormatProvider? provider)
Converts the value of this instance to an equivalent <see cref="T:System.String" /> using the specified culture-specific formatting information.
Returns A <see cref="T:System.String" /> instance equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
object
ToType​(Type conversionType, IFormatProvider? provider)
Converts the value of this instance to an <see cref="T:System.Object" /> of the specified <see cref="T:System.Type" /> that has an equivalent value, using the specified culture-specific formatting information.
Returns An <see cref="T:System.Object" /> instance of type <paramref name="conversionType" /> whose value is equivalent to the value of this instance.
conversionType The <see cref="T:System.Type" /> to which the value of this instance is converted.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
ushort
ToUInt16​(IFormatProvider provider)
Converts the value of this instance to an equivalent 16-bit unsigned integer using the specified culture-specific formatting information.
Returns An 16-bit unsigned integer equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
uint
ToUInt32​(IFormatProvider provider)
Converts the value of this instance to an equivalent 32-bit unsigned integer using the specified culture-specific formatting information.
Returns An 32-bit unsigned integer equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.
ulong
ToUInt64​(IFormatProvider provider)
Converts the value of this instance to an equivalent 64-bit unsigned integer using the specified culture-specific formatting information.
Returns An 64-bit unsigned integer equivalent to the value of this instance.
provider An <see cref="T:System.IFormatProvider" /> interface implementation that supplies culture-specific formatting information.