Namespace: System
Convert
Converts a base data type to another base data type.
Methods (20)
long ToInt64(String,Int32)
Converts the string representation of a number in a specified base to an equivalent 64-bit signed integer.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
| fromBase | The base of the number in value, which must be 2, 8, 10, or 16. |
Returns: A 64-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null.
ulong ToUInt64(String,Int32)
Converts the string representation of a number in a specified base to an equivalent 64-bit unsigned integer.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
| fromBase | The base of the number in value, which must be 2, 8, 10, or 16. |
Returns: A 64-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null.
int ToInt32(String,Int32)
Converts the string representation of a number in a specified base to an equivalent 32-bit signed integer.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
| fromBase | The base of the number in value, which must be 2, 8, 10, or 16. |
Returns: A 32-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null.
uint ToUInt32(String,Int32)
Converts the string representation of a number in a specified base to an equivalent 32-bit unsigned integer.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
| fromBase | The base of the number in value, which must be 2, 8, 10, or 16. |
Returns: A 32-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null.
short ToInt16(String,Int32)
Converts the string representation of a number in a specified base to an equivalent 16-bit signed integer.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
| fromBase | The base of the number in value, which must be 2, 8, 10, or 16. |
Returns: A 16-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null.
ushort ToUInt16(String,Int32)
Converts the string representation of a number in a specified base to an equivalent 16-bit unsigned integer.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
| fromBase | The base of the number in value, which must be 2, 8, 10, or 16. |
Returns: A 16-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null.
long ToInt64(String)
Converts the specified string representation of a number to an equivalent 64-bit signed integer.
| Parameter | Description |
|---|---|
| value | A string that contains a number to convert. |
Returns: A 64-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null.
ulong ToUInt64(String)
Converts the specified string representation of a number to an equivalent 64-bit unsigned integer.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
Returns: A 64-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null.
int ToInt32(String)
Converts the specified string representation of a number to an equivalent 32-bit signed integer.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
Returns: A 32-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null.
uint ToUInt32(String)
Converts the specified string representation of a number to an equivalent 32-bit unsigned integer.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
Returns: A 32-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null.
short ToInt16(String)
Converts the specified string representation of a number to an equivalent 16-bit signed integer.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
Returns: A 16-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null.
ushort ToUInt16(String)
Converts the specified string representation of a number to an equivalent 16-bit unsigned integer.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
Returns: A 16-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null.
double ToDouble(String)
Converts the specified string representation of a number to an equivalent double-precision floating-point number.
| Parameter | Description |
|---|---|
| value | A string that contains the number to convert. |
Returns: A double-precision floating-point number that is equivalent to the number in value, or 0 (zero) if value is null.
String ToBase64String(Byte[],Int32,Int32)
Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits. Parameters specify the subset as an offset in the input array, and the number of elements in the array to convert.
| Parameter | Description |
|---|---|
| inArray | An array of 8-bit unsigned integers. |
| offset | An offset in inArray. |
| length | The number of elements of inArray to convert. |
Returns: The string representation in base 64 of length elements of inArray, starting at position offset.
String ToBase64String(Byte[])
Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits.
| Parameter | Description |
|---|---|
| inArray | An array of 8-bit unsigned integers. |
Returns: The string representation, in base 64, of the contents of inArray.
byte[] FromBase64String(String)
Converts the specified string, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array.
| Parameter | Description |
|---|---|
| s | The string to convert. |
Returns: An array of 8-bit unsigned integers that is equivalent to s.
String ToString(Int16,Int32)
Converts the value of a 16-bit signed integer to its equivalent string representation in a specified base.
| Parameter | Description |
|---|---|
| value | The 16-bit signed integer to convert. |
| toBase | The base of the return value, which must be 2, 8, 10, or 16. |
Returns: The string representation of value in base toBase.
String ToString(Int32,Int32)
Converts the value of a 32-bit signed integer to its equivalent string representation in a specified base.
| Parameter | Description |
|---|---|
| value | The 32-bit signed integer to convert. |
| toBase | The base of the return value, which must be 2, 8, 10, or 16. |
Returns: The string representation of value in base toBase.
String ToString(Int64,Int32)
Converts the value of a 64-bit signed integer to its equivalent string representation in a specified base.
| Parameter | Description |
|---|---|
| value | The 64-bit signed integer to convert. |
| toBase | The base of the return value, which must be 2, 8, 10, or 16. |
Returns: The string representation of value in base toBase.
String ToString(Double)
Converts the value of the specified double-precision floating-point number to its equivalent string representation.
| Parameter | Description |
|---|---|
| value | The double-precision floating-point number to convert. |
Returns: The string representation of value.