BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Object

The static methods of the class are used to support conversion to and from the base data types in the .NET Framework. The supported base types are , , , , , , , , , , , , , and .

## Conversions to and from Base Types

A conversion method exists to convert every base type to every other base type. However, the actual call to a particular conversion method can produce one of five outcomes, depending on the value of the base type at run time and the target base type. These five outcomes are:

No conversion. This occurs when an attempt is made to convert from a type to itself (for example, by calling with an argument of type ). In this case, the method simply returns an instance of the original type.

An . This occurs when a particular conversion is not supported. An is thrown for the following conversions:

Conversions from to , , , , or .

Conversions from , , , , or to .

Conversions from to any other type except .

Conversions from any other type, except , to .

A . This occurs when the attempt to convert a string value to any other base type fails because the string is not in the proper format. The exception is thrown for the following conversions:

A string to be converted to a value does not equal or .

A string to be converted to a value consists of multiple characters.

A string to be converted to any numeric type is not recognized as a valid number.

A string to be converted to a is not recognized as a valid date and time value.

A successful conversion. For conversions between two different base types not listed in the previous outcomes, all widening conversions as well as all narrowing conversions that do not result in a loss of data will succeed and the method will return a value of the targeted base type.

An . This occurs when a narrowing conversion results in a loss of data. For example, trying to convert a instance whose value is 10000 to a type throws an because 10000 is outside the range of the data type.

An exception will not be thrown if the conversion of a numeric type results in a loss of precision (that is, the loss of some least significant digits). However, an exception will be thrown if the result is larger than can be represented by the particular conversion method's return value type.

For example, when a is converted to a , a loss of precision might occur but no exception is thrown. However, if the magnitude of the is too large to be represented by a , an overflow exception is thrown.

## Conversions from Custom Objects to Base Types

In addition to supporting conversions between the base types, the method supports conversion of any custom type to any base type. To do this, the custom type must implement the interface, which defines methods for converting the implementing type to each of the base types. Conversions that are not supported by a particular type should throw an .

When the method is passed a custom type as its first parameter, or when the Convert.ToType method (such as or is called and passed an instance of a custom type as its first parameter, the method, in turn, calls the custom type's implementation to perform the conversion. For more information, see Type Conversion in the .NET Framework.

## Culture-Specific Formatting Information

All the base type conversion methods and the method include overloads that have a parameter of type . For example, the method has the following two overloads:

The parameter can supply culture-specific formatting information to assist the conversion process. However, it is ignored by most of the base type conversion methods. It is used only by the following base type conversion methods. If a null argument is passed to these methods, the object that represents the current thread culture is used.

By methods that convert a value to a numeric type. The parameter is used by the overload that has parameters of type and . It is also used by the overload that has parameters of type and if the object's run-time type is a .

By methods that convert a value to a date and time. The parameter is used by the overload that has parameters of type and . It is also used by the overload that has parameters of type and if the object's run-time type is a .

By the overloads that include an parameter and that convert either a numeric value to a string or a value to a string.

However, any user-defined type that implements can make use of the parameter.

## Other Conversion Methods

A set of methods support converting an array of bytes to and from a or to and from an array of Unicode characters consisting of base-64 digit characters. Data expressed as base-64 digits can be easily conveyed over data channels that can only transmit 7-bit characters.

Converts a base data type to another base data type.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object `` ``

  is a general-purpose conversion method that converts the object specified by to . The parameter can be an object of any type, and can also be a object that represents any base or custom type. For the conversion to succeed, must implement the interface, because the method simply wraps a call to an appropriate method. The method requires that conversion of to be supported.

  This method uses the current thread's culture for the conversion.

  Returns an object of the specified type and whose value is equivalent to the specified object.

  An object whose type is and whose value is equivalent to .

  -or-

  A null reference (Nothing in Visual Basic), if is null and is not a value type.

  An object that implements the interface. The type of object to return.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object `` ``

  is a general-purpose conversion method that converts the object specified by to a predefined type specified by . The parameter can be an object of any type. For the conversion to succeed, must implement the interface, because the method simply wraps a call to an appropriate method. The method also requires that conversion of to be supported.

  The method does not support the conversion of to a custom type. To perform such a conversion, call the method.

  Returns an object of the specified type whose value is equivalent to the specified object.

  An object whose underlying type is and whose value is equivalent to .

  -or-

  A null reference (Nothing in Visual Basic), if is null and is , , or .

  An object that implements the interface. The type of object to return.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object `` `` ``

  is a general-purpose conversion method that converts the object specified by to . The parameter can be an object of any type, and can also be a object that represents any base or custom type. For the conversion to succeed, must implement the interface, because the method simply wraps a call to an appropriate method. The method requires that conversion of to be supported.

  The parameter is an implementation that supplies formatting information for the conversion. Whether and how this parameter is used depends on the underlying implementation. If is a base data type, is used only for the following conversions:

  Conversion from a number to a string, or from a string to a number. must be a object, a object, or a custom implementation that returns a object. However, because the method performs the conversion using the default "G" format specifier, the parameter has no effect if or the target type is an unsigned integer. If is null, the object that represents the current thread culture is used.

  Conversion from a value to a string, or from a string to a value. must be a or object. If is null, the object that represents the current thread culture is used.

  If is an application-defined type, its implementation may use the parameter.

  Returns an object of the specified type whose value is equivalent to the specified object. A parameter supplies culture-specific formatting information.

  An object whose type is and whose value is equivalent to .

  -or-

  , if the of and are equal.

  -or-

  A null reference (Nothing in Visual Basic), if is null and is not a value type.

  An object that implements the interface. The type of object to return. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object `` `` ``

  is a general-purpose conversion method that converts the object specified by to a predefined type specified by . The parameter can be an object of any type. For the conversion to succeed, must implement the interface, because the method simply wraps a call to an appropriate method. The method also requires that conversion of to be supported.

  The method does not support the conversion of to a custom type. To perform such a conversion, call the method.

  The parameter is an implementation that supplies formatting information for the conversion. Whether and how this parameter is used depends on the underlying implementation. If is a base data type, is used only for the following conversions. If a null argument is passed to these methods, the object that represents the current thread culture is used.

  Conversion from a number to a string, or from a string to a number. must be a object, a object, or a custom implementation that returns a object. However, because the method performs the conversion using the default "G" format specifier, the parameter has no effect if or the target type is an unsigned integer.

  Conversion from a value to a string, or from a string to a value. must be a or object.

  If is an application-defined type, its implementation may use the parameter.

  Returns an object of the specified type whose value is equivalent to the specified object. A parameter supplies culture-specific formatting information.

  An object whose underlying type is and whose value is equivalent to .

  -or-

  A null reference (Nothing in Visual Basic), if is null and is , , or .

  An object that implements the interface. The type of object to return. An object that supplies culture-specific formatting information.
- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Object

  The field is equivalent to , as the following example shows.

  code reference: System.Convert.DBNull#1

  A constant that represents a database column that is absent of data; that is, database null.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte[] `` `` ``

  is composed of base-64 digits, white-space characters, and trailing padding characters. The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", lowercase characters "a" to "z", numerals "0" to "9", and the symbols "+" and "/".

  The white-space characters, and their Unicode names and hexadecimal code points, are tab (CHARACTER TABULATION, U+0009), newline (LINE FEED, U+000A), carriage return (CARRIAGE RETURN, U+000D), and blank (SPACE, U+0020). An arbitrary number of white-space characters can appear in because all white-space characters are ignored.

  The valueless character, "=", is used for trailing padding. The end of can consist of zero, one, or two padding characters.

  The method is designed to process a single character array that contains all the data to be decoded. To decode base-64 character data from a stream, use the class.

  Converts a subset of a Unicode character array, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array. Parameters specify the subset in the input array and the number of elements to convert.

  An array of 8-bit unsigned integers equivalent to elements at position in .

  A Unicode character array. A position within . The number of elements in to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte[] ``

  is composed of base-64 digits, white-space characters, and trailing padding characters. The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", lowercase characters "a" to "z", numerals "0" to "9", and the symbols "+" and "/".

  The white-space characters, and their Unicode names and hexadecimal code points, are tab (CHARACTER TABULATION, U+0009), newline (LINE FEED, U+000A), carriage return (CARRIAGE RETURN, U+000D), and blank (SPACE, U+0020). An arbitrary number of white-space characters can appear in because all white-space characters are ignored.

  The valueless character, "=", is used for trailing padding. The end of can consist of zero, one, or two padding characters.

  The method is designed to process a single string that contains all the data to be decoded. To decode base-64 character data from a stream, use the class.

  Converts the specified string, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array.

  An array of 8-bit unsigned integers that is equivalent to .

  The string to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.TypeCode `` To be added.

  Returns the for the specified object.

  The for , or if is null.

  An object that implements the interface.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  The method tests whether the parameter is equal to . It is equivalent to the following code:

  code reference: System.Convert.IsDBNull#1

  is used to indicate a value that is missing. It is not equivalent to null or to . Therefore, code such as Convert.IsDBNull(null) in C# or Convert.IsDBNull(Nothing) in Visual Basic returns false.

  Returns an indication whether the specified object is of type .

  true if is of type ; otherwise, false.

  An object.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` `` `` ``

  The subset of elements of starting at position , are taken as a numeric value and converted to a subset of elements in starting at position . The return value indicates the number of converted elements in . The subset of consists of base-64 digits.

  The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character, "=", is used for trailing padding.

  The and parameters are 32-bit signed numbers. The and parameters are zero-based array positions.

  The method is designed to process a single byte array that contains all the data to be encoded. To create a base-64 character array from a byte stream, use the class.

  Converts a subset of an 8-bit unsigned integer array to an equivalent subset of a Unicode character array encoded with base-64 digits. Parameters specify the subsets as offsets in the input and output arrays, and the number of elements in the input array to convert.

  A 32-bit signed integer containing the number of bytes in .

  An input array of 8-bit unsigned integers. A position within . The number of elements of to convert. An output array of Unicode characters. A position within .
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32 `` `` `` `` `` ``

  The subset of elements of the parameter starting at position , are taken as a numeric value and converted to a subset of elements in the parameter starting at position . The return value indicates the number of converted elements in . The subset of consists of base-64 digits.

  The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character "=" is used for trailing padding.

  The and parameters are 32-bit signed numbers. The and parameters are zero-based array positions.

  The method is designed to process a single byte array that contains all the data to be encoded. To create a base-64 character array from a byte stream, use the class.

  If the parameter is set to and the output of the conversion is longer than 76 characters, a line break is inserted every 76 characters. A line break is defined as a carriage return character (U+000D) followed by a line feed character (U+000A). For more information, see RFC 2045, "Multipurpose Internet Mail Extensions", at http://www.rfc-editor.org/.

  Converts a subset of an 8-bit unsigned integer array to an equivalent subset of a Unicode character array encoded with base-64 digits. Parameters specify the subsets as offsets in the input and output arrays, the number of elements in the input array to convert, and whether line breaks are inserted in the output array.

  A 32-bit signed integer containing the number of bytes in .

  An input array of 8-bit unsigned integers. A position within . The number of elements of to convert. An output array of Unicode characters. A position within . to insert a line break every 76 characters, or to not insert line breaks.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  The elements of are taken as a numeric value and converted to a string representation that is encoded with base-64 digits.

  The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character, "=", is used for trailing padding.

  The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class.

  Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits.

  The string representation, in base 64, of the contents of .

  An array of 8-bit unsigned integers.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String `` ``

  The elements of the parameter are taken as a numeric value and converted to a string representation in base 64.

  The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character "=" is used for trailing padding.

  The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class.

  If the parameter is set to and the output of the conversion is longer than 76 characters, a line break is inserted every 76 characters. A line break is defined as a carriage return character (U+000D) followed by a line feed character (U+000A). For more information, see RFC 2045, "Multipurpose Internet Mail Extensions", at http://www.rfc-editor.org/.

  Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits. A parameter specifies whether to insert line breaks in the return value.

  The string representation in base 64 of the elements in .

  An array of 8-bit unsigned integers. to insert a line break every 76 characters, or to not insert line breaks.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` ``

  The elements of are taken as a numeric value and converted to a string representation in base 64.

  The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character, "=", is used for trailing padding.

  The and parameters are 32-bit signed numbers. The parameter is zero-based.

  The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class.

  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.

  The string representation in base 64 of elements of , starting at position .

  An array of 8-bit unsigned integers. An offset in . The number of elements of to convert.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.String `` `` `` ``

  The elements of the parameter are taken as a numeric value and converted to a string representation in base 64.

  The base-64 digits in ascending order from zero are the uppercase characters "A" to "Z", the lowercase characters "a" to "z", the numerals "0" to "9", and the symbols "+" and "/". The valueless character "=" is used for trailing padding.

  The and parameters are 32-bit signed numbers. The parameter is zero-based.

  The method is designed to process a single byte array that contains all the data to be encoded. To encode data from a stream, use the class.

  If the parameter is set to and the output of the conversion is longer than 76 characters, a line break is inserted every 76 characters. A line break is defined as a carriage return character (U+000D) followed by a line feed character (U+000A). For more information, see RFC 2045, "Multipurpose Internet Mail Extensions", at http://www.rfc-editor.org/.

  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, the number of elements in the array to convert, and whether to insert line breaks in the return value.

  The string representation in base 64 of elements of , starting at position .

  An array of 8-bit unsigned integers. An offset in . The number of elements of to convert. to insert a line break every 76 characters, or to not insert line breaks.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This method is provided for completeness.

  Returns the specified Boolean value; no actual conversion is performed.

  is returned unchanged.

  The Boolean value to return. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { byte byte0 = (byte) 0; byte byte1 = (Byte) 1; bool bool0 = Convert.ToBoolean(byte0); bool bool1 = Convert.ToBoolean(byte1); Console.WriteLine("(byte) {0} as bool = {1}",byte0,bool0); Console.WriteLine("(byte) {0} as bool = {1}",byte1,bool1); } }`

  The output is

  (byte) 0 as bool = False

  (byte) 1 as bool = True

  Converts the value of the specified 8-bit unsigned integer to an equivalent Boolean value.

  true if is not zero; otherwise, false.

  The 8-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The Unicode character to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { decimal decimal0 = 0m; decimal decimal1 = 1m; decimal decimal2 = -2m; bool bool0 = Convert.ToBoolean(decimal0); bool bool1 = Convert.ToBoolean(decimal1); bool bool2 = Convert.ToBoolean(decimal2); Console.WriteLine("(decimal) {0} as bool = {1}",decimal0,bool0); Console.WriteLine("(decimal) {0} as bool = {1}",decimal1,bool1); Console.WriteLine("(decimal) {0} as bool = {1}",decimal2,bool2); } }`

  The output is

  (decimal) 0 as bool = False

  (decimal) 1 as bool = True

  (decimal) -2 as bool = True

  Converts the value of the specified decimal number to an equivalent Boolean value.

  true if is not zero; otherwise, false.

  The number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { double double0 = 0.0; double double1 = 1.0; double double2 = -2.0; bool bool0 = Convert.ToBoolean(double0); bool bool1 = Convert.ToBoolean(double1); bool bool2 = Convert.ToBoolean(double2); Console.WriteLine("(double) {0} as bool = {1}",double0,bool0); Console.WriteLine("(double) {0} as bool = {1}",double1,bool1); Console.WriteLine("(double) {0} as bool = {1}",double2,bool2); } }`

  The output is

  (double) 0 as bool = False

  (double) 1 as bool = True

  (double) -2 as bool = True

  Converts the value of the specified double-precision floating-point number to an equivalent Boolean value.

  true if is not zero; otherwise, false.

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { short short0 = 0; short short1 = 1; short short2 = -2; bool bool0 = Convert.ToBoolean(short0); bool bool1 = Convert.ToBoolean(short1); bool bool2 = Convert.ToBoolean(short2); Console.WriteLine("(short) {0} as bool = {1}",short0,bool0); Console.WriteLine("(short) {0} as bool = {1}",short1,bool1); Console.WriteLine("(short) {0} as bool = {1}",short2,bool2); } }`

  The output is

  (short) 0 as bool = False

  (short) 1 as bool = True

  (short) -2 as bool = True

  Converts the value of the specified 16-bit signed integer to an equivalent Boolean value.

  true if is not zero; otherwise, false.

  The 16-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { int int0 = 0; int int1 = 1; int int2 = -2; bool bool0 = Convert.ToBoolean(int0); bool bool1 = Convert.ToBoolean(int1); bool bool2 = Convert.ToBoolean(int2); Console.WriteLine("(int) {0} as bool = {1}",int0,bool0); Console.WriteLine("(int) {0} as bool = {1}",int1,bool1); Console.WriteLine("(int) {0} as bool = {1}",int2,bool2); } }`

  The output is

  (int) 0 as bool = False

  (int) 1 as bool = True

  (int) -2 as bool = True

  Converts the value of the specified 32-bit signed integer to an equivalent Boolean value.

  true if is not zero; otherwise, false.

  The 32-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { long long0 = 0; long long1 = 1; long long2 = -2; bool bool0 = Convert.ToBoolean(long0); bool bool1 = Convert.ToBoolean(long1); bool bool2 = Convert.ToBoolean(long2); Console.WriteLine("(long) {0} as bool = {1}",long0,bool0); Console.WriteLine("(long) {0} as bool = {1}",long1,bool1); Console.WriteLine("(long) {0} as bool = {1}",long2,bool2); } }`

  The output is

  (long) 0 as bool = False

  (long) 1 as bool = True

  (long) -2 as bool = True

  Converts the value of the specified 64-bit signed integer to an equivalent Boolean value.

  true if is not zero; otherwise, false.

  The 64-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  Converts the value of a specified object to an equivalent Boolean value.

  true or false, which reflects the value returned by invoking the method for the underlying type of . If is null, the method returns false.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { sbyte sbyte0 = (sbyte) 0; sbyte sbyte1 = (sbyte) 1; sbyte sbyte2 = (sbyte) -2; bool bool0 = Convert.ToBoolean(sbyte0); bool bool1 = Convert.ToBoolean(sbyte1); bool bool2 = Convert.ToBoolean(sbyte2); Console.WriteLine("(sbyte) {0} as bool = {1}",sbyte0,bool0); Console.WriteLine("(sbyte) {0} as bool = {1}",sbyte1,bool1); Console.WriteLine("(sbyte) {0} as bool = {1}",sbyte2,bool2); } }`

  The output is

  (sbyte) 0 as bool = False

  (sbyte) 1 as bool = True

  (sbyte) -2 as bool = True

  Converts the value of the specified 8-bit signed integer to an equivalent Boolean value.

  true if is not zero; otherwise, false.

  The 8-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added.

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { float float0 = 0.0f; float float1 = 1.0f; float float2 = -2.0f; bool bool0 = Convert.ToBoolean(float0); bool bool1 = Convert.ToBoolean(float1); bool bool2 = Convert.ToBoolean(float2); Console.WriteLine("(float) {0} as bool = {1}",float0,bool0); Console.WriteLine("(float) {0} as bool = {1}",float1,bool1); Console.WriteLine("(float) {0} as bool = {1}",float2,bool2); } }`

  The output is

  (float) 0 as bool = False

  (float) 1 as bool = True

  (float) -2 as bool = True

  Converts the value of the specified single-precision floating-point number to an equivalent Boolean value.

  true if is not zero; otherwise, false.

  The single-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` is a null reference. is not equal to or .

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { string string0 = Boolean.TrueString; string string1 = Boolean.FalseString; string string2 = "foo"; //This is an invalid Boolean. bool bool0 = Convert.ToBoolean(string0); bool bool1 = Convert.ToBoolean(string1); Console.WriteLine("(string) {0} as bool = {1}",string0,bool0); Console.WriteLine("(string) {0} as bool = {1}",string1,bool1); bool bool2 = Convert.ToBoolean(string2); //Throws an exception. Console.WriteLine("(string) {0} as bool = {1}",string2,bool2); } }`

  The output is

  `(string) True as bool = True (string) False as bool = False Unhandled Exception: System.FormatException: String was not recognized as a valid Boolean. at System.Boolean.Parse(String value) at Convert.ToBoolean(String value) at ConvertBoolTest.Main() in C:\ECMAExamples\ConvertString.cs:line 12`

  For a successful conversion to occur, the parameter must equal either , a constant whose value is True, , a constant whose value is False, or it must be null. In comparing with and , the method ignores case as well as leading and trailing white space.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a logical value to its Boolean equivalent.

  true if equals , or false if equals or null.

  A string that contains the value of either or . 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { ushort ushort0 = 0; ushort ushort1 = 1; bool bool0 = Convert.ToBoolean(ushort0); bool bool1 = Convert.ToBoolean(ushort1); Console.WriteLine("(ushort) {0} as bool = {1}",ushort0,bool0); Console.WriteLine("(ushort) {0} as bool = {1}",ushort1,bool1); } }`

  The output is

  (ushort) 0 as bool = False

  (ushort) 1 as bool = True

  Converts the value of the specified 16-bit unsigned integer to an equivalent Boolean value.

  true if is not zero; otherwise, false.

  The 16-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { uint uint0 = 0; uint uint1 = 1; bool bool0 = Convert.ToBoolean(uint0); bool bool1 = Convert.ToBoolean(uint1); Console.WriteLine("(uint) {0} as bool = {1}",uint0,bool0); Console.WriteLine("(uint) {0} as bool = {1}",uint1,bool1); } }`

  The output is

  (uint) 0 as bool = False

  (uint) 1 as bool = True

  Converts the value of the specified 32-bit unsigned integer to an equivalent Boolean value.

  true if is not zero; otherwise, false.

  The 32-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Boolean ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  The following example demonstrates converting values to values.

  `using System; class ConvertBoolTest { static public void Main() { ulong ulong0 = 0; ulong ulong1 = 1; bool bool0 = Convert.ToBoolean(ulong0); bool bool1 = Convert.ToBoolean(ulong1); Console.WriteLine("(ulong) {0} as bool = {1}",ulong0,bool0); Console.WriteLine("(ulong) {0} as bool = {1}",ulong1,bool1); } }`

  The output is

  (ulong) 0 as bool = False

  (ulong) 1 as bool = True

  Converts the value of the specified 64-bit unsigned integer to an equivalent Boolean value.

  true if is not zero; otherwise, false.

  The 64-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  enables the user to specify culture-specific conversion information about the contents of . The base types ignore the parameter; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to an equivalent Boolean value, using the specified culture-specific formatting information.

  true or false, which reflects the value returned by invoking the method for the underlying type of . If is null, the method returns false.

  An object that implements the interface, or null. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean `` ``

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a logical value to its Boolean equivalent, using the specified culture-specific formatting information.

  true if equals , or false if equals or null.

  A string that contains the value of either or . An object that supplies culture-specific formatting information. This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` To be added.

  Converts the specified Boolean value to the equivalent 8-bit unsigned integer.

  The number 1 if is true; otherwise, 0.

  The Boolean value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte ``

  This method is provided for completeness.

  Returns the specified 8-bit unsigned integer; no actual conversion is performed.

  is returned unchanged.

  The 8-bit unsigned integer to return. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` The numeric value of is greater than .

  The following example demonstrates converting values to values.

  `using System; class ConvertByteTest { static public void Main() { char char0 = '0'; char char1 = '1'; char char2 = 'a'; byte byte0 = Convert.ToByte(char0); byte byte1 = Convert.ToByte(char1); byte byte2 = Convert.ToByte(char2); Console.WriteLine("(char) {0} as byte = {1}",char0,byte0); Console.WriteLine("(char) {0} as byte = {1}",char1,byte1); Console.WriteLine("(char) {0} as byte = {1}",char2,byte2); } }`

  The output is

  (char) 0 as byte = 48

  (char) 1 as byte = 49

  (char) a as byte = 97

  This method returns an unsigned byte value that represents the numeric code of the object passed to it. In the .NET Framework, a object is a 16-bit value. This means that the method is suitable for returning the numeric codes of characters in the ASCII character range or in the Unicode C0 Controls and Basic Latin, and C1 Controls and Latin-1 Supplement ranges, from U+0000 to U+00FF.

  Converts the value of the specified Unicode character to the equivalent 8-bit unsigned integer.

  An 8-bit unsigned integer that is equivalent to .

  The Unicode character to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` is greater than or less than .

  The following example demonstrates converting values to values.

  `using System; class ConvertByteTest { static public void Main() { decimal decimal0 = 0.0m; decimal decimal1 = 1.5m; decimal decimal2 = 2.5m; decimal decimal3 = -1.0m; byte byte0 = Convert.ToByte(decimal0); byte byte1 = Convert.ToByte(decimal1); byte byte2 = Convert.ToByte(decimal2); Console.WriteLine("(decimal) {0} as byte = {1}",decimal0,byte0); Console.WriteLine("(decimal) {0} as byte = {1}",decimal1,byte1); Console.WriteLine("(decimal) {0} as byte = {1}",decimal2,byte2); byte byte3 = Convert.ToByte(decimal3); //Throws an exception. Console.WriteLine("(decimal) {0} as byte = {1}",decimal3,byte3); } }`

  The output is

  (decimal) 0 as byte = 0

  (decimal) 1.5 as byte = 2

  (decimal) 2.5 as byte = 2

  Exception occurred: System.OverflowException: Value was either too large or too small for an unsigned byte.

  at System.Decimal.ToByte(Decimal value)

  at Convert.ToByte(Decimal value)

  at ConvertByteTest.Main() in C:\ECMAExamples\ConvertToByte\ConvertDecimal.cs:line 15

  The following example converts a value to a and a value to a .

  code reference: System.Convert Snippets#18

  Converts the value of the specified decimal number to an equivalent 8-bit unsigned integer.

  , rounded to the nearest 8-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte ``

  Prior to the conversion, if is halfway between two numbers, it is rounded to the number that has an even digit in the rightmost decimal position. For example, when rounded to two decimals, the value 2.345 becomes 2.34 and the value 2.355 becomes 2.36

  is greater than or less than , or is equal to one of , , or .

  The following example demonstrates converting values to values.

  `using System; class ConvertByteTest { static public void Main() { double double0 = 0.0; double double1 = 1.5; double double2 = 2.5; double double3 = -1.0; byte byte0 = Convert.ToByte(double0); byte byte1 = Convert.ToByte(double1); byte byte2 = Convert.ToByte(double2); Console.WriteLine("(double) {0} as byte = {1}",double0,byte0); Console.WriteLine("(double) {0} as byte = {1}",double1,byte1); Console.WriteLine("(double) {0} as byte = {1}",double2,byte2); byte byte3 = Convert.ToByte(double3); //Throws an exception. Console.WriteLine("(double) {0} as byte = {1}",double3,byte3); } }`

  The output is

  (double) 0 as byte = 0

  (double) 1.5 as byte = 2

  (double) 2.5 as byte = 2

  Exception occurred: System.OverflowException: Value was either too large or too small for an unsigned byte.

  at Convert.ToByte(Int32 value)

  at Convert.ToByte(Double value)

  at ConvertByteTest.Main() in C:\ECMAExamples\ConvertToByte\ConvertDouble.cs:line 15

  Converts the value of the specified double-precision floating-point number to an equivalent 8-bit unsigned integer.

  , rounded to the nearest 8-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` To be added. is greater than or less than .

  Converts the value of the specified 16-bit signed integer to an equivalent 8-bit unsigned integer.

  An 8-bit unsigned integer that is equivalent to .

  The 16-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` To be added. is greater than or less than .

  Converts the value of the specified 32-bit signed integer to an equivalent 8-bit unsigned integer.

  An 8-bit unsigned integer that is equivalent to .

  The 32-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` To be added. is greater than or less than .

  Converts the value of the specified 64-bit signed integer to an equivalent 8-bit unsigned integer.

  An 8-bit unsigned integer that is equivalent to .

  The 64-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte ``

  If is not null, this method wraps a call to the implementation of the underlying type of .

  Converts the value of the specified object to an 8-bit unsigned integer.

  An 8-bit unsigned integer that is equivalent to , or zero if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Byte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is less than .

  Converts the value of the specified 8-bit signed integer to an equivalent 8-bit unsigned integer.

  An 8-bit unsigned integer that is equivalent to .

  The 8-bit signed integer to be converted. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  is greater than or less than , or is equal to one of , , or .

  The following example demonstrates converting values to values.

  `using System; class ConvertByteTest { static public void Main() { float float0 = 0.0f; float float1 = 1.5f; float float2 = 2.5f; float float3 = -1.0f; byte byte0 = Convert.ToByte(float0); byte byte1 = Convert.ToByte(float1); byte byte2 = Convert.ToByte(float2); Console.WriteLine("(float) {0} as byte = {1}",float0,byte0); Console.WriteLine("(float) {0} as byte = {1}",float1,byte1); Console.WriteLine("(float) {0} as byte = {1}",float2,byte2); byte byte3 = Convert.ToByte(float3); //Throws an exception. Console.WriteLine("(float) {0} as byte = {1}",float3,byte3); } }`

  The output is

  (float) 0 as byte = 0

  (float) 1.5 as byte = 2

  (float) 2.5 as byte = 2

  Exception occurred: System.OverflowException: Value was either too large or too small for an unsigned byte.

  at Convert.ToByte(Int32 value)

  at Convert.ToByte(Single value)

  at ConvertByteTest.Main() in C:\ECMAExamples\ConvertToByte\ConvertFloat.cs:line 15

  Converts the value of the specified single-precision floating-point number to an equivalent 8-bit unsigned integer.

  , rounded to the nearest 8-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  A single-precision floating-point number. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` is a null reference. does not consist of an optional sign followed by one or more digits (zero through nine). The numeric value of is greater than or less than .

  The following example demonstrates converting values to values.

  `using System; class ConvertByteTest { static public void Main() { string string0 = "+22"; string string1 = "0"; string string2 = "-1"; byte byte0 = Convert.ToByte(string0); byte byte1 = Convert.ToByte(string1); Console.WriteLine("(string) {0} as byte = {1}",string0,byte0); Console.WriteLine("(string) {0} as byte = {1}",string1,byte1); byte byte2 = Convert.ToByte(string2); Console.WriteLine("(string) {0} as byte = {1}",string2,byte2); } }`

  The output is

  (string) +22 as byte = 22

  (string) 0 as byte = 0

  Exception occurred: System.OverflowException: Value was either too large or too small for an unsigned byte.

  at System.Byte.Parse(String s, NumberStyles style, IFormatProvider provider)

  at System.Byte.Parse(String s)

  at Convert.ToByte(String value)

  at ConvertByteTest.Main() in C:\ECMAExamples\ConvertToByte\ConvertString.cs:line 11

  Using the method is equivalent to passing to the method. is interpreted by using the formatting conventions of the current thread culture.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 8-bit unsigned integer.

  An 8-bit unsigned integer that is equivalent to , or zero if is null.

  A string that contains the number to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Byte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  The following example demonstrates converting values to values.

  `using System; class ConvertByteTest { static public void Main() { ushort ushort0 = 0; ushort ushort1 = 32000; byte byte0 = Convert.ToByte(ushort0); Console.WriteLine("(ushort) {0} as byte = {1}",ushort0,byte0); byte byte1 = Convert.ToByte(ushort1); //Throws an exception. Console.WriteLine("(ushort) {0} as byte = {1}",ushort1,byte1); } }`

  The output is

  (ushort) 0 as byte = 0

  Exception occurred: System.OverflowException: Value was either too large or too small for an unsigned byte.

  at Convert.ToByte(UInt16 value)

  at ConvertByteTest.Main() in C:\ECMAExamples\ConvertToByte\ConvertUInt16.cs:line 8

  Converts the value of the specified 16-bit unsigned integer to an equivalent 8-bit unsigned integer.

  An 8-bit unsigned integer that is equivalent to .

  The 16-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Byte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 32-bit unsigned integer to an equivalent 8-bit unsigned integer.

  An 8-bit unsigned integer that is equivalent to .

  The 32-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Byte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  The following example demonstrates converting values to values.

  `using System; class ConvertByteTest { static public void Main() { ulong ulong0 = 0; ulong ulong1 = 32000; byte byte0 = Convert.ToByte(ulong0); Console.WriteLine("(ulong) {0} as byte = {1}",ulong0,byte0); byte byte1 = Convert.ToByte(ulong1); //Throws an exception. Console.WriteLine("(ulong) {0} as byte = {1}",ulong1,byte1); } }`

  The output is

  (ulong) 0 as byte = 0

  Exception occurred: System.OverflowException: Value was either too large or too small for an unsigned byte.

  at Convert.ToByte(UInt64 value)

  at ConvertByteTest.Main() in C:\ECMAExamples\ConvertToByte\ConvertUInt64.cs:line 8

  Converts the value of the specified 64-bit unsigned integer to an equivalent 8-bit unsigned integer.

  An 8-bit unsigned integer that is equivalent to .

  The 64-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` ``

  enables the user to specify culture-specific conversion information about the contents of . The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to an 8-bit unsigned integer, using the specified culture-specific formatting information.

  An 8-bit unsigned integer that is equivalent to , or zero if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` `` is a null reference. does not consist of an optional sign followed by one or more digits (zero through nine). The numeric value of is greater than or less than .

  is an instance that obtains a object. The object provides culture-specific information about the format of . If is null, the object for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 8-bit unsigned integer, using specified culture-specific formatting information.

  An 8-bit unsigned integer that is equivalent to , or zero if is null.

  A string that contains the number to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Byte `` ``

  If is 16, you can prefix the number specified by the parameter with "0x" or "0X".

  Because the data type supports unsigned values only, the method assumes that is expressed using unsigned binary representation. In other words, all eight bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed byte value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x80 converts to 128."

  code reference: System.Convert.BaseConversion#3

  When performing binary operations or numeric conversions, it is always the responsibility of the developer to verify that a method or operator is using the appropriate numeric representation to interpret a particular value. The following example illustrates one technique for ensuring that the method does not inappropriately use unsigned binary representation when it converts a hexadecimal string representation to a value. The example determines whether a value represents a signed or an unsigned integer while it is converting that value to its string representation. When the example converts the value back to a value, it checks whether the original value was a signed integer. If so, and if its high-order bit is set (which indicates that the value is negative and that it uses two's complement instead of unsigned binary representation), the method throws an exception.

  code reference: System.Convert.BaseConversion#4

  Converts the string representation of a number in a specified base to an equivalent 8-bit unsigned integer.

  An 8-bit unsigned integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. The base of the number in , which must be 2, 8, 10, or 16.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The Boolean value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` To be added.

  Converts the value of the specified 8-bit unsigned integer to its equivalent Unicode character.

  A Unicode character that is equivalent to .

  The 8-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char ``

  This method is provided for completeness.

  Returns the specified Unicode character value; no actual conversion is performed.

  is returned unchanged.

  The Unicode character to return. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The decimal number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The double-precision floating-point number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` To be added. is less than .

  Converts the value of the specified 16-bit signed integer to its equivalent Unicode character.

  A Unicode character that is equivalent to .

  The 16-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` To be added. is greater than or less than .

  Converts the value of the specified 32-bit signed integer to its equivalent Unicode character.

  A Unicode character that is equivalent to .

  The 32-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` To be added. is greater than or less than .

  Converts the value of the specified 64-bit signed integer to its equivalent Unicode character.

  A Unicode character that is equivalent to .

  The 64-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char ``

  If is not null, this method wraps a call to the implementation of the underlying type of .

  Converts the value of the specified object to a Unicode character.

  A Unicode character that is equivalent to value, or if is null.

  An object that implements the interface.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Char ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  value is less than .

  Converts the value of the specified 8-bit signed integer to its equivalent Unicode character.

  A Unicode character that is equivalent to .

  The 8-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The single-precision floating-point number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` does not contain exactly one character.

  must be a string that contains a single character.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the first character of a specified string to a Unicode character.

  A Unicode character that is equivalent to the first and only character in .

  A string of length 1. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Char ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 16-bit unsigned integer to its equivalent Unicode character.

  A Unicode character that is equivalent to .

  The 16-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Char `` To be added. is greater than .

  Converts the value of the specified 32-bit unsigned integer to its equivalent Unicode character.

  A Unicode character that is equivalent to .

  The 32-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Char ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 64-bit unsigned integer to its equivalent Unicode character.

  A Unicode character that is equivalent to .

  The 64-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` ``

  The return value is the result of invoking the method of the underlying type of .

  enables the user to specify culture-specific conversion information about the contents of . The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to its equivalent Unicode character, using the specified culture-specific formatting information.

  A Unicode character that is equivalent to , or if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Char `` ``

  must be a string that contains a single character.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the first character of a specified string to a Unicode character, using specified culture-specific formatting information.

  A Unicode character that is equivalent to the first and only character in .

  A string of length 1 or null. An object that supplies culture-specific formatting information. This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The Boolean value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The 8-bit unsigned integer to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The Unicode character to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime ``

  This method is provided for completeness.

  Returns the specified object; no actual conversion is performed.

  is returned unchanged.

  A date and time value. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The number to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The double-precision floating-point value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The 16-bit signed integer to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The 32-bit signed integer to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The 64-bit signed integer to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime ``

  For the conversion to succeed, the runtime type of the parameter must be either a or a , or must be null. Otherwise, the method throws an . In addition, if is a string, it must contain a valid representation of a date and time value in the current culture or a is thrown.

  The return value is the result of invoking the method of the underlying type of .

  Converts the value of the specified object to a object.

  The date and time equivalent of the value of , or a date and time equivalent of if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The 8-bit signed integer to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The single-precision floating-point value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` is a null reference. cannot be converted to a .

  If is not null, the return value is the result of invoking the method on using the formatting information in a object that is initialized for the current culture. The argument must contain the representation of a date and time in one of the formats described in the topic. If is null, the method returns .

  This method tries to parse completely and avoid throwing a . It completes missing month, day, and year information with the current date. If contains only a date and no time, this method assumes a time of midnight. Any leading, inner, or trailing white-space characters in are ignored.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a date and time to an equivalent date and time value.

  The date and time equivalent of the value of , or the date and time equivalent of if is null.

  The string representation of a date and time. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The 16-bit unsigned integer to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The 32-bit unsigned integer to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.DateTime `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The 64-bit unsigned integer to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` ``

  The return value is the result of invoking the method of the underlying type of .

  enables the user to specify culture-specific conversion information about the contents of . For example, if is a that represents a date, could supply culture-specific information about the notation used to represent that date. is involved in the conversion of if the runtime type of is a , or if is a user-defined type whose implementation makes use of . If the runtime type of is and is null, the object that represents the current thread culture is used.

  Converts the value of the specified object to a object, using the specified culture-specific formatting information.

  The date and time equivalent of the value of , or the date and time equivalent of if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime `` `` is a null reference. cannot be converted to a .

  The return value is the result of invoking the method on .

  is an instance that obtains a object. The object provides culture-specific information about the format of . If is null, the for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent date and time, using the specified culture-specific formatting information.

  The date and time equivalent of the value of , or the date and time equivalent of if is null.

  A string that contains a date and time to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` To be added.

  Converts the specified Boolean value to the equivalent decimal number.

  The number 1 if is true; otherwise, 0.

  The Boolean value to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` To be added.

  Converts the value of the specified 8-bit unsigned integer to the equivalent decimal number.

  The decimal number that is equivalent to .

  The 8-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The Unicode character to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal ``

  This method is provided for completeness.

  Returns the specified decimal number; no actual conversion is performed.

  is returned unchanged.

  A decimal number. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` The numeric value of is greater than or less than .

  The value returned by this method contains a maximum of 15 significant digits. If the parameter contains more than 15 significant digits, it is rounded using rounding to nearest. The following example illustrates how the method uses rounding to nearest to return a value with 15 significant digits.

  code reference: System.Convert.ToDecimal#2

  Converts the value of the specified double-precision floating-point number to an equivalent decimal number.

  A decimal number that is equivalent to .

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` To be added.

  Converts the value of the specified 16-bit signed integer to an equivalent decimal number.

  A decimal number that is equivalent to .

  The 16-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` To be added.

  Converts the value of the specified 32-bit signed integer to an equivalent decimal number.

  A decimal number that is equivalent to .

  The 32-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` To be added.

  Converts the value of the specified 64-bit signed integer to an equivalent decimal number.

  A decimal number that is equivalent to .

  The 64-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal ``

  The return value is the result of invoking the method of the underlying type of .

  Converts the value of the specified object to an equivalent decimal number.

  A decimal number that is equivalent to , or 0 (zero) if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Decimal ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 8-bit signed integer to the equivalent decimal number.

  A decimal number that is equivalent to .

  The 8-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` The numeric value of is greater than or less than .

  The value returned by this method contains a maximum of seven significant digits. If the parameter contains more than seven significant digits, it is rounded using rounding to nearest. The following example illustrates how the method uses rounding to nearest to return a value with seven significant digits.

  code reference: System.Convert.ToDecimal#1

  Converts the value of the specified single-precision floating-point number to the equivalent decimal number.

  A decimal number that is equivalent to .

  The single-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  Using the method is equivalent to passing to the method. is interpreted by using the formatting conventions of the current thread culture.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent decimal number.

  A decimal number that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains a number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Decimal ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 16-bit unsigned integer to an equivalent decimal number.

  The decimal number that is equivalent to .

  The 16-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Decimal ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 32-bit unsigned integer to an equivalent decimal number.

  A decimal number that is equivalent to .

  The 32-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Decimal ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 64-bit unsigned integer to an equivalent decimal number.

  A decimal number that is equivalent to .

  The 64-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` ``

  The return value is the result of invoking the method of the underlying type of .

  enables the user to specify culture-specific conversion information about the contents of . The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to an equivalent decimal number, using the specified culture-specific formatting information.

  A decimal number that is equivalent to , or 0 (zero) if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Decimal `` `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  The return value is the result of invoking the method on .

  is an instance that obtains a object. The object provides culture-specific information about the format of . If is null, the for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent decimal number, using the specified culture-specific formatting information.

  A decimal number that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains a number to convert. An object that supplies culture-specific formatting information. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` To be added.

  Converts the specified Boolean value to the equivalent double-precision floating-point number.

  The number 1 if is true; otherwise, 0.

  The Boolean value to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` To be added.

  Converts the value of the specified 8-bit unsigned integer to the equivalent double-precision floating-point number.

  The double-precision floating-point number that is equivalent to .

  The 8-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The Unicode character to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` To be added.

  Converts the value of the specified decimal number to an equivalent double-precision floating-point number.

  A double-precision floating-point number that is equivalent to .

  The decimal number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double ``

  This method is provided for completeness.

  Returns the specified double-precision floating-point number; no actual conversion is performed.

  is returned unchanged.

  The double-precision floating-point number to return. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` To be added.

  Converts the value of the specified 16-bit signed integer to an equivalent double-precision floating-point number.

  A double-precision floating-point number equivalent to .

  The 16-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` To be added.

  Converts the value of the specified 32-bit signed integer to an equivalent double-precision floating-point number.

  A double-precision floating-point number that is equivalent to .

  The 32-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` To be added.

  Converts the value of the specified 64-bit signed integer to an equivalent double-precision floating-point number.

  A double-precision floating-point number that is equivalent to .

  The 64-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double ``

  If is not null, this method wraps a call to the implementation of the underlying type of .

  Converts the value of the specified object to a double-precision floating-point number.

  A double-precision floating-point number that is equivalent to , or zero if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Double ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 8-bit signed integer to the equivalent double-precision floating-point number.

  The 8-bit signed integer that is equivalent to .

  The 8-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` To be added.

  Converts the value of the specified single-precision floating-point number to an equivalent double-precision floating-point number.

  A double-precision floating-point number that is equivalent to .

  The single-precision floating-point number. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  Using the method is equivalent to passing to the method. is interpreted by using the formatting conventions of the current thread culture.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent double-precision floating-point number.

  A double-precision floating-point number that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Double ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 16-bit unsigned integer to the equivalent double-precision floating-point number.

  A double-precision floating-point number that is equivalent to .

  The 16-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Double ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 32-bit unsigned integer to an equivalent double-precision floating-point number.

  A double-precision floating-point number that is equivalent to .

  The 32-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Double ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 64-bit unsigned integer to an equivalent double-precision floating-point number.

  A double-precision floating-point number that is equivalent to .

  The 64-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` ``

  The return value is the result of invoking the method of the underlying type of .

  enables the user to specify culture-specific conversion information about the contents of . For example, if is a that represents a number, could supply culture-specific information about the notation used to represent that number.

  The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to an double-precision floating-point number, using the specified culture-specific formatting information.

  A double-precision floating-point number that is equivalent to , or zero if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Double `` `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  The return value is the result of invoking the method on .

  is an instance that obtains a object. The object provides culture-specific information about the format of . If is null, the for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent double-precision floating-point number, using the specified culture-specific formatting information.

  A double-precision floating-point number that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. An object that supplies culture-specific formatting information. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` To be added.

  Converts the specified Boolean value to the equivalent 16-bit signed integer.

  The number 1 if is true; otherwise, 0.

  The Boolean value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` To be added.

  Converts the value of the specified 8-bit unsigned integer to the equivalent 16-bit signed integer.

  A 16-bit signed integer that is equivalent to .

  The 8-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` To be added. The numeric value of is greater than .

  Converts the value of the specified Unicode character to the equivalent 16-bit signed integer.

  A 16-bit signed integer that is equivalent to .

  The Unicode character to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  is greater than or less than .

  Converts the value of the specified decimal number to an equivalent 16-bit signed integer.

  , rounded to the nearest 16-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The decimal number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  is greater than or less than .

  Converts the value of the specified double-precision floating-point number to an equivalent 16-bit signed integer.

  , rounded to the nearest 16-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 ``

  This method is provided for completeness.

  Returns the specified 16-bit signed integer; no actual conversion is performed.

  is returned unchanged.

  The 16-bit signed integer to return. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` To be added. is greater than or less than .

  Converts the value of the specified 32-bit signed integer to an equivalent 16-bit signed integer.

  The 16-bit signed integer equivalent of .

  The 32-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` To be added. value is greater than or less than .

  Converts the value of the specified 64-bit signed integer to an equivalent 16-bit signed integer.

  A 16-bit signed integer that is equivalent to .

  The 64-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 ``

  If is not null, this method wraps a call to the implementation of the underlying type of .

  Converts the value of the specified object to a 16-bit signed integer.

  A 16-bit signed integer that is equivalent to , or zero if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 8-bit signed integer to the equivalent 16-bit signed integer.

  A 8-bit signed integer that is equivalent to .

  The 8-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  is greater than or less than .

  Converts the value of the specified single-precision floating-point number to an equivalent 16-bit signed integer.

  , rounded to the nearest 16-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The single-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  Using the method is equivalent to passing to the method. is interpreted by using the formatting conventions of the current thread culture.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 16-bit signed integer.

  A 16-bit signed integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 16-bit unsigned integer to the equivalent 16-bit signed integer.

  A 16-bit signed integer that is equivalent to .

  The 16-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 32-bit unsigned integer to an equivalent 16-bit signed integer.

  A 16-bit signed integer that is equivalent to .

  The 32-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 64-bit unsigned integer to an equivalent 16-bit signed integer.

  A 16-bit signed integer that is equivalent to .

  The 64-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` ``

  enables the user to specify culture-specific conversion information about the contents of . For example, if is a that represents a number, could supply culture-specific information about the notation used to represent that number.

  The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to a 16-bit signed integer, using the specified culture-specific formatting information.

  A 16-bit signed integer that is equivalent to , or zero if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  is an instance that obtains a object. The object provides culture-specific information about the format of . If is null, the for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 16-bit signed integer, using the specified culture-specific formatting information.

  A 16-bit signed integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int16 `` ``

  If is 16, you can prefix the number specified by the parameter with "0x" or "0X".

  Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two’s complement representation. In other words, the method always interprets the highest-order binary bit of an integer (bit 15) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example increments by one, converts the resulting number to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x8000 converts to -32768."

  code reference: System.Convert.BaseConversion#5

  When performing binary operations or numeric conversions, it is always the responsibility of the developer to verify that a method is using the appropriate numeric representation to interpret a particular value. As the following example illustrates, you can ensure that the method handles overflows appropriately by first retrieving the sign of the numeric value before converting it to its hexadecimal string representation. Throw an exception if the original value was positive but the conversion back to an integer yields a negative value.

  code reference: System.Convert.BaseConversion#6

  Converts the string representation of a number in a specified base to an equivalent 16-bit signed integer.

  A 16-bit signed integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. The base of the number in , which must be 2, 8, 10, or 16.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Converts the specified Boolean value to the equivalent 32-bit signed integer.

  The number 1 if is true; otherwise, 0.

  The Boolean value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Converts the value of the specified 8-bit unsigned integer to the equivalent 32-bit signed integer.

  A 32-bit signed integer that is equivalent to .

  The 8-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  A 32-bit signed integer that represents the UTF-16 encoded code point of the parameter.

  Converts the value of the specified Unicode character to the equivalent 32-bit signed integer.

  A 32-bit signed integer that is equivalent to .

  The Unicode character to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  is greater than or less than .

  Converts the value of the specified decimal number to an equivalent 32-bit signed integer.

  , rounded to the nearest 32-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The decimal number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  is greater than or less than .

  Converts the value of the specified double-precision floating-point number to an equivalent 32-bit signed integer.

  , rounded to the nearest 32-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added.

  Converts the value of the specified 16-bit signed integer to an equivalent 32-bit signed integer.

  A 32-bit signed integer that is equivalent to .

  The 16-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This method is provided for completeness.

  Returns the specified 32-bit signed integer; no actual conversion is performed.

  is returned unchanged.

  The 32-bit signed integer to return. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added. is greater than or less than .

  Converts the value of the specified 64-bit signed integer to an equivalent 32-bit signed integer.

  A 32-bit signed integer that is equivalent to .

  The 64-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  If is not null, this method wraps a call to the implementation of the underlying type of .

  Converts the value of the specified object to a 32-bit signed integer.

  A 32-bit signed integer equivalent to , or zero if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 8-bit signed integer to the equivalent 32-bit signed integer.

  A 8-bit signed integer that is equivalent to .

  The 8-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  is greater than or less than .

  Converts the value of the specified single-precision floating-point number to an equivalent 32-bit signed integer.

  , rounded to the nearest 32-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The single-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  Using the method is equivalent to passing to the method. is interpreted by using the formatting conventions of the current thread culture.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 32-bit signed integer.

  A 32-bit signed integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 16-bit unsigned integer to the equivalent 32-bit signed integer.

  A 32-bit signed integer that is equivalent to .

  The 16-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 32-bit unsigned integer to an equivalent 32-bit signed integer.

  A 32-bit signed integer that is equivalent to .

  The 32-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 64-bit unsigned integer to an equivalent 32-bit signed integer.

  A 32-bit signed integer that is equivalent to .

  The 64-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  The return value is the result of invoking the method of the underlying type of .

  enables the user to specify culture-specific conversion information about the contents of . For example, if is a that represents a number, could supply culture-specific information about the notation used to represent that number.

  The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to a 32-bit signed integer, using the specified culture-specific formatting information.

  A 32-bit signed integer that is equivalent to , or zero if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  The return value is the result of invoking the method on .

  is an instance that obtains a object. The object provides culture-specific information about the format of . If is null, the for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 32-bit signed integer, using the specified culture-specific formatting information.

  A 32-bit signed integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 `` ``

  If is 16, you can prefix the number specified by the parameter with "0x" or "0X".

  Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two’s complement representation. In other words, the method always interprets the highest-order binary bit of an integer (bit 31) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example increments by one, converts the resulting number to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x80000000 converts to -2147483648."

  code reference: System.Convert.BaseConversion#1

  When performing binary operations or numeric conversions, it is always the responsibility of the developer to verify that a method is using the appropriate numeric representation to interpret a particular value. As the following example illustrates, you can ensure that the method handles overflows appropriately by first retrieving the sign of the numeric value before converting it to its hexadecimal string representation. Throw an exception if the original value was positive but the conversion back to an integer yields a negative value.

  code reference: System.Convert.BaseConversion#2

  Converts the string representation of a number in a specified base to an equivalent 32-bit signed integer.

  A 32-bit signed integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. The base of the number in , which must be 2, 8, 10, or 16.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` To be added.

  Converts the specified Boolean value to the equivalent 64-bit signed integer.

  The number 1 if is true; otherwise, 0.

  The Boolean value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` To be added.

  Converts the value of the specified 8-bit unsigned integer to the equivalent 64-bit signed integer.

  A 64-bit signed integer that is equivalent to .

  The 8-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` To be added.

  Converts the value of the specified Unicode character to the equivalent 64-bit signed integer.

  A 64-bit signed integer that is equivalent to .

  The Unicode character to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  is greater than or less than .

  Converts the value of the specified decimal number to an equivalent 64-bit signed integer.

  , rounded to the nearest 64-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The decimal number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  is greater than or less than .

  Converts the value of the specified double-precision floating-point number to an equivalent 64-bit signed integer.

  , rounded to the nearest 64-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` To be added.

  Converts the value of the specified 16-bit signed integer to an equivalent 64-bit signed integer.

  A 64-bit signed integer that is equivalent to .

  The 16-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` To be added.

  Converts the value of the specified 32-bit signed integer to an equivalent 64-bit signed integer.

  A 64-bit signed integer that is equivalent to .

  The 32-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 ``

  This method is provided for completeness.

  Returns the specified 64-bit signed integer; no actual conversion is performed.

  is returned unchanged.

  A 64-bit signed integer. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 ``

  If is not null, this method wraps a call to the implementation of the underlying type of .

  Converts the value of the specified object to a 64-bit signed integer.

  A 64-bit signed integer that is equivalent to , or zero if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 8-bit signed integer to the equivalent 64-bit signed integer.

  A 64-bit signed integer that is equivalent to .

  The 8-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  is greater than or less than .

  Converts the value of the specified single-precision floating-point number to an equivalent 64-bit signed integer.

  , rounded to the nearest 64-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The single-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  Using the method is equivalent to passing to the method. is interpreted by using the formatting conventions of the current thread culture.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 64-bit signed integer.

  A 64-bit signed integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains a number to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 16-bit unsigned integer to the equivalent 64-bit signed integer.

  A 64-bit signed integer that is equivalent to .

  The 16-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 32-bit unsigned integer to an equivalent 64-bit signed integer.

  A 64-bit signed integer that is equivalent to .

  The 32-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Int64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 64-bit unsigned integer to an equivalent 64-bit signed integer.

  A 64-bit signed integer that is equivalent to .

  The 64-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` ``

  The return value is the result of invoking the method of the underlying type of .

  enables the user to specify culture-specific conversion information about the contents of . For example, if is a that represents a number, could supply culture-specific information about the notation used to represent that number.

  The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to a 64-bit signed integer, using the specified culture-specific formatting information.

  A 64-bit signed integer that is equivalent to , or zero if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  The return value is the result of invoking the method on .

  is an IFormatProvider instance that obtains a object. The NumberFormatInfo object provides culture-specific information about the format of . If is null, the NumberFormatInfo for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 64-bit signed integer, using the specified culture-specific formatting information.

  A 64-bit signed integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` ``

  If is 16, you can prefix the number specified by the parameter with "0x" or "0X".

  Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two’s complement representation. In other words, the method always interprets the highest-order binary bit of a long integer (bit 63) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0xFFFFFFFFFFFFFFFF converts to -1."

  code reference: System.Convert.BaseConversion#7

  When performing binary operations or numeric conversions, it is always the responsibility of the developer to verify that a method is using the appropriate numeric representation to interpret a particular value. As the following example illustrates, you can ensure that the method handles overflows appropriately by first determining whether a value represents an unsigned or a signed type when converting it to its hexadecimal string representation. Throw an exception if the original value was an unsigned type but the conversion back to an integer yields a value whose sign bit is on.

  code reference: System.Convert.BaseConversion#8

  The following example attempts to interpret each element in a string array as a hexadecimal string and convert it to a long integer.

  code reference: System.Convert.ToInt64#15

  Converts the string representation of a number in a specified base to an equivalent 64-bit signed integer.

  A 64-bit signed integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. The base of the number in , which must be 2, 8, 10, or 16.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the specified Boolean value to the equivalent 8-bit signed integer.

  The number 1 if is true; otherwise, 0.

  The Boolean value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 8-bit unsigned integer to the equivalent 8-bit signed integer.

  An 8-bit signed integer that is equivalent to .

  The 8-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  The numeric value of is greater than .

  Converts the value of the specified Unicode character to the equivalent 8-bit signed integer.

  An 8-bit signed integer that is equivalent to .

  The Unicode character to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified decimal number to an equivalent 8-bit signed integer.

  , rounded to the nearest 8-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The decimal number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified double-precision floating-point number to an equivalent 8-bit signed integer.

  , rounded to the nearest 8-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified 16-bit signed integer to the equivalent 8-bit signed integer.

  An 8-bit signed integer that is equivalent to .

  The 16-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified 32-bit signed integer to an equivalent 8-bit signed integer.

  An 8-bit signed integer that is equivalent to .

  The 32-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified 64-bit signed integer to an equivalent 8-bit signed integer.

  An 8-bit signed integer that is equivalent to .

  The 64-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  The return value is the result of invoking the method of the underlying type of .

  Converts the value of the specified object to an 8-bit signed integer.

  An 8-bit signed integer that is equivalent to , or zero if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  This method is provided for completeness.

  Returns the specified 8-bit signed integer; no actual conversion is performed.

  is returned unchanged.

  The 8-bit signed integer to return. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified single-precision floating-point number to an equivalent 8-bit signed integer.

  , rounded to the nearest 8-bit signed integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The single-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte `` is a null reference. cannot be converted to a numeric value in the specified format. The numeric value of is greater than or less than .

  Using the method is equivalent to passing to the method. is interpreted by using the formatting conventions of the current thread culture.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 8-bit signed integer.

  An 8-bit signed integer that is equivalent to the number in , or 0 (zero) if value is null.

  A string that contains the number to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 16-bit unsigned integer to the equivalent 8-bit signed integer.

  An 8-bit signed integer that is equivalent to .

  The 16-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 32-bit unsigned integer to an equivalent 8-bit signed integer.

  An 8-bit signed integer that is equivalent to .

  The 32-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 64-bit unsigned integer to an equivalent 8-bit signed integer.

  An 8-bit signed integer that is equivalent to .

  The 64-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte `` ``

  enables the user to specify culture-specific conversion information about the contents of . For example, if is a that represents a number, could supply culture-specific information about the notation used to represent that number.

  The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to an 8-bit signed integer, using the specified culture-specific formatting information.

  An 8-bit signed integer that is equivalent to , or zero if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte `` ``

  is an instance that obtains a object. The object provides culture-specific information about the format of . If is null, the for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 8-bit signed integer, using the specified culture-specific formatting information.

  An 8-bit signed integer that is equivalent to .

  A string that contains the number to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.SByte `` ``

  If is 16, you can prefix the number specified by the parameter with "0x" or "0X".

  Because the negative sign is not supported for non-base 10 numeric representations, the method assumes that negative numbers use two’s complement representation. In other words, the method always interprets the high-order bit of a byte (bit 7) as its sign bit. As a result, it is possible to write code in which a non-base 10 number that is out of the range of the data type is converted to an value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0xff converts to -1."

  code reference: System.Convert.BaseConversion#9

  When performing binary operations or numeric conversions, it is always the responsibility of the developer to verify that a method is using the appropriate numeric representation to interpret a particular value. As the following example illustrates, you can ensure that the method handles overflows appropriately by first determining whether a value represents an unsigned or a signed type when converting it to its hexadecimal string representation. Throw an exception if the original value was an unsigned type but the conversion back to a signed byte yields a value whose sign bit is on.

  code reference: System.Convert.BaseConversion#10

  Converts the string representation of a number in a specified base to an equivalent 8-bit signed integer.

  An 8-bit signed integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. The base of the number in , which must be 2, 8, 10, or 16.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` To be added.

  Converts the specified Boolean value to the equivalent single-precision floating-point number.

  The number 1 if is true; otherwise, 0.

  The Boolean value to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` To be added.

  Converts the value of the specified 8-bit unsigned integer to the equivalent single-precision floating-point number.

  A single-precision floating-point number that is equivalent to .

  The 8-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The Unicode character to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` To be added.

  Converts the value of the specified decimal number to an equivalent single-precision floating-point number.

  A single-precision floating-point number that is equivalent to .

  is rounded using rounding to nearest. For example, when rounded to two decimals, the value 2.345 becomes 2.34 and the value 2.355 becomes 2.36.

  The decimal number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` To be added. is greater than or less than .

  Converts the value of the specified double-precision floating-point number to an equivalent single-precision floating-point number.

  A single-precision floating-point number that is equivalent to .

  is rounded using rounding to nearest. For example, when rounded to two decimals, the value 2.345 becomes 2.34 and the value 2.355 becomes 2.36.

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` To be added.

  Converts the value of the specified 16-bit signed integer to an equivalent single-precision floating-point number.

  A single-precision floating-point number that is equivalent to .

  The 16-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` To be added.

  Converts the value of the specified 32-bit signed integer to an equivalent single-precision floating-point number.

  A single-precision floating-point number that is equivalent to .

  The 32-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` To be added.

  Converts the value of the specified 64-bit signed integer to an equivalent single-precision floating-point number.

  A single-precision floating-point number that is equivalent to .

  The 64-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single ``

  The return value is the result of invoking the method of the underlying type of .

  Converts the value of the specified object to a single-precision floating-point number.

  A single-precision floating-point number that is equivalent to , or zero if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Single ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 8-bit signed integer to the equivalent single-precision floating-point number.

  An 8-bit signed integer that is equivalent to .

  The 8-bit signed integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single ``

  This method is provided for completeness.

  Returns the specified single-precision floating-point number; no actual conversion is performed.

  is returned unchanged.

  The single-precision floating-point number to return. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  Using the method is equivalent to passing to the method. is interpreted by using the formatting conventions of the current thread culture.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent single-precision floating-point number.

  A single-precision floating-point number that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Single ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 16-bit unsigned integer to the equivalent single-precision floating-point number.

  A single-precision floating-point number that is equivalent to .

  The 16-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Single ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 32-bit unsigned integer to an equivalent single-precision floating-point number.

  A single-precision floating-point number that is equivalent to .

  The 32-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Single ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 64-bit unsigned integer to an equivalent single-precision floating-point number.

  A single-precision floating-point number that is equivalent to .

  The 64-bit unsigned integer to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` ``

  The return value is the result of invoking the method of the underlying type of .

  enables the user to specify culture-specific conversion information about the contents of . For example, if is a that represents a number, could supply culture-specific information about the notation used to represent that number.

  The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to an single-precision floating-point number, using the specified culture-specific formatting information.

  A single-precision floating-point number that is equivalent to , or zero if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Single `` `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  The return value is the result of invoking the method on .

  is an instance that obtains a object. The object provides culture-specific information about the format of . If is null, the for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent single-precision floating-point number, using the specified culture-specific formatting information.

  A single-precision floating-point number that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. An object that supplies culture-specific formatting information. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This implementation is identical to . It returns for true values and for false values.

  Converts the specified Boolean value to its equivalent string representation.

  The string representation of .

  The Boolean value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This implementation is identical to .

  Converts the value of the specified 8-bit unsigned integer to its equivalent string representation.

  The string representation of .

  The 8-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This implementation is identical to .

  Converts the value of the specified Unicode character to its equivalent string representation.

  The string representation of .

  The Unicode character to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This implementation is identical to . It uses the formatting conventions of the current culture and the "G" format specifier to convert a value to its string representation.

  Converts the value of the specified to its equivalent string representation.

  The string representation of .

  The date and time value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This implementation is identical to .

  Converts the value of the specified decimal number to its equivalent string representation.

  The string representation of .

  The decimal number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This implementation is identical to .

  Converts the value of the specified double-precision floating-point number to its equivalent string representation.

  The string representation of .

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This implementation is identical to .

  Converts the value of the specified 16-bit signed integer to its equivalent string representation.

  The string representation of .

  The 16-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This implementation is identical to .

  Converts the value of the specified 32-bit signed integer to its equivalent string representation.

  The string representation of .

  The 32-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This implementation is identical to .

  Converts the value of the specified 64-bit signed integer to its equivalent string representation.

  The string representation of .

  The 64-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  To convert to its string representation, the method tries to call the implementation of . If does not implement the interface, the method tries to call the implementation of . If value does not implement the interface, the method calls the ToString method of the underlying type of .

  Converts the value of the specified object to its equivalent string representation.

  The string representation of , or if value is null.

  An object that supplies the value to convert, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.String ``

  This implementation is identical to .

  Converts the value of the specified 8-bit signed integer to its equivalent string representation.

  The string representation of .

  The 8-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This implementation is identical to .

  Converts the value of the specified single-precision floating-point number to its equivalent string representation.

  The string representation of .

  The single-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String ``

  This method is provided for completeness.

  Returns the specified string instance; no actual conversion is performed.

  is returned unchanged.

  The string to return. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.String ``

  This implementation is identical to .

  Converts the value of the specified 16-bit unsigned integer to its equivalent string representation.

  The string representation of .

  The 16-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.String ``

  This implementation is identical to .

  Converts the value of the specified 32-bit unsigned integer to its equivalent string representation.

  The string representation of .

  The 32-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.String ``

  This implementation is identical to .

  Converts the value of the specified 64-bit unsigned integer to its equivalent string representation.

  The string representation of .

  The 64-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  This implementation is identical to . It returns for true values and for false values.

  Converts the specified Boolean value to its equivalent string representation.

  The string representation of .

  The Boolean value to convert. An instance of an object. This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified 8-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The 8-bit unsigned integer to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  If does not equal 10, the string that is returned by the method represents by its magnitude only. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a magnitude-only numeric representation should be called to perform the conversion. Such methods include or .

  Converts the value of an 8-bit unsigned integer to its equivalent string representation in a specified base.

  The string representation of in base .

  The 8-bit unsigned integer to convert. The base of the return value, which must be 2, 8, 10, or 16.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified Unicode character to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The Unicode character to convert. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The date and time value to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified decimal number to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The decimal number to convert. An object that supplies culture-specific formatting information. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  This implementation is identical to

  Converts the value of the specified double-precision floating-point number to its equivalent string representation.

  The string representation of .

  The double-precision floating-point number to convert. An object that supplies culture-specific formatting information. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified 16-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The 16-bit signed integer to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  If is positive and is 2, 8, or 16, the returned string uses sign-and-magnitude representation. If is negative and is 2, 8, or 16, the returned string uses two's complement representation. This means that the high-order bit of the high-order byte (bit 15) is interpreted as the sign bit. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and .

  Converts the value of a 16-bit signed integer to its equivalent string representation in a specified base.

  The string representation of in base .

  The 16-bit signed integer to convert. The base of the return value, which must be 2, 8, 10, or 16.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified 32-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The 32-bit signed integer to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  If is positive and is 2, 8, or 16, the returned string uses sign-and-magnitude representation. If is negative and is 2, 8, or 16, the returned string uses two's complement representation. This means that the high-order bit of the highest-order byte (bit 31) is interpreted as the sign bit. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and .

  Converts the value of a 32-bit signed integer to its equivalent string representation in a specified base.

  The string representation of in base .

  The 32-bit signed integer to convert. The base of the return value, which must be 2, 8, 10, or 16.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified 64-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The 64-bit signed integer to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  If is positive and is not 10, the returned string uses sign-and-magnitude representation. If is negative and is not 10, the returned string uses two's complement representation. This means that the high-order bit of the highest-order byte (bit 63) is interpreted as the sign bit. If the method is called to create a string that will later be converted back to a number, a corresponding method that assumes a similar numeric representation should be called to perform the conversion. Such methods include and .

  Converts the value of a 64-bit signed integer to its equivalent string representation in a specified base.

  The string representation of in base .

  The 64-bit signed integer to convert. The base of the return value, which must be 2, 8, 10, or 16.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  If the parameter implements the interface, the method calls the implementation of . Otherwise, if the parameter implements the interface, the method calls its implementation. If implements neither interface, the method calls the parameter's ToString() method, and the parameter is ignored.

  The parameter is used if the parameter implements the or interface. The most common use of the parameter is to specify culture-specific information used in the conversion of . For example, if the parameter is a negative decimal number, the parameter can supply culture-specific information about the notation used for the negative sign and decimal separator. The second example in the next section illustrates a format provider that does not supply culture-sensitive formatting information.

  Converts the value of the specified object to its equivalent string representation using the specified culture-specific formatting information.

  The string representation of , or if is null.

  An object that supplies the value to convert, or null. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified 8-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The 8-bit signed integer to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified single-precision floating-point number to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The single-precision floating-point number to convert. An object that supplies culture-specific formatting information. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String `` `` To be added.

  Returns the specified string instance; no actual conversion is performed.

  is returned unchanged.

  The string to return. An object that supplies culture-specific formatting information. This parameter is ignored.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified 16-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The 16-bit unsigned integer to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified 32-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The 32-bit unsigned integer to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.String `` ``

  This implementation is identical to .

  Converts the value of the specified 64-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information.

  The string representation of .

  The 64-bit unsigned integer to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the specified Boolean value to the equivalent 16-bit unsigned integer.

  The number 1 if is true; otherwise, 0.

  The Boolean value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 8-bit unsigned integer to the equivalent 16-bit unsigned integer.

  A 16-bit unsigned integer that is equivalent to .

  The 8-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified Unicode character to the equivalent 16-bit unsigned integer.

  The 16-bit unsigned integer equivalent to .

  The Unicode character to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified decimal number to an equivalent 16-bit unsigned integer.

  , rounded to the nearest 16-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The decimal number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified double-precision floating-point number to an equivalent 16-bit unsigned integer.

  , rounded to the nearest 16-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is less than .

  Converts the value of the specified 16-bit signed integer to the equivalent 16-bit unsigned integer.

  A 16-bit unsigned integer that is equivalent to .

  The 16-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified 32-bit signed integer to an equivalent 16-bit unsigned integer.

  A 16-bit unsigned integer that is equivalent to .

  The 32-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified 64-bit signed integer to an equivalent 16-bit unsigned integer.

  A 16-bit unsigned integer that is equivalent to .

  The 64-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  The return value is the result of invoking the method of the underlying type of .

  Converts the value of the specified object to a 16-bit unsigned integer.

  A 16-bit unsigned integer that is equivalent to , or zero if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is less than .

  Converts the value of the specified 8-bit signed integer to the equivalent 16-bit unsigned integer.

  A 16-bit unsigned integer that is equivalent to .

  The 8-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified single-precision floating-point number to an equivalent 16-bit unsigned integer.

  , rounded to the nearest 16-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The single-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  Using the method is equivalent to passing to the method. is interpreted by using the formatting conventions of the current thread culture.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 16-bit unsigned integer.

  A 16-bit unsigned integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  This method is provided for completeness.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Returns the specified 16-bit unsigned integer; no actual conversion is performed.

  is returned unchanged.

  The 16-bit unsigned integer to return. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 32-bit unsigned integer to an equivalent 16-bit unsigned integer.

  A 16-bit unsigned integer that is equivalent to .

  The 32-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 64-bit unsigned integer to an equivalent 16-bit unsigned integer.

  A 16-bit unsigned integer that is equivalent to .

  The 64-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 `` ``

  The return value is the result of invoking the method of the underlying type of .

  enables the user to specify culture-specific conversion information about the contents of . For example, if is a that represents a number, could supply culture-specific information about the notation used to represent that number.

  The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to a 16-bit unsigned integer, using the specified culture-specific formatting information.

  A 16-bit unsigned integer that is equivalent to , or zero if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 `` `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  The return value is the result of invoking on .

  is an instance that obtains a object. The object provides culture-specific information about the format of . If is null, the for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 16-bit unsigned integer, using the specified culture-specific formatting information.

  A 16-bit unsigned integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt16 `` ``

  If is 16, you can prefix the number specified by the parameter with "0x" or "0X".

  Because the data type supports unsigned values only, the method assumes that is expressed using unsigned binary representation. In other words, all 16 bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed integer value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x8000 converts to 32768."

  code reference: System.Convert.BaseConversion#11

  When performing binary operations or numeric conversions, it is always the responsibility of the developer to verify that a method or operator is using the appropriate numeric representation to interpret a particular value. The following example illustrates one technique for ensuring that the method does not inappropriately use binary representation to interpret a value that uses two's complement representation when converting a hexadecimal string to a value. The example determines whether a value represents a signed or an unsigned integer while it is converting that value to its string representation. When the example converts the value to a value, it checks whether the original value was a signed integer. If so, and if its high-order bit is set (which indicates that the original value was negative), the method throws an exception.

  code reference: System.Convert.BaseConversion#12

  Converts the string representation of a number in a specified base to an equivalent 16-bit unsigned integer.

  A 16-bit unsigned integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. The base of the number in , which must be 2, 8, 10, or 16.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the specified Boolean value to the equivalent 32-bit unsigned integer.

  The number 1 if is true; otherwise, 0.

  The Boolean value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 8-bit unsigned integer to the equivalent 32-bit unsigned integer.

  A 32-bit unsigned integer that is equivalent to .

  The 8-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified Unicode character to the equivalent 32-bit unsigned integer.

  A 32-bit unsigned integer that is equivalent to .

  The Unicode character to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified decimal number to an equivalent 32-bit unsigned integer.

  , rounded to the nearest 32-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The decimal number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified double-precision floating-point number to an equivalent 32-bit unsigned integer.

  , rounded to the nearest 32-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is less than .

  Converts the value of the specified 16-bit signed integer to the equivalent 32-bit unsigned integer.

  A 32-bit unsigned integer that is equivalent to .

  The 16-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is less than .

  Converts the value of the specified 32-bit signed integer to an equivalent 32-bit unsigned integer.

  A 32-bit unsigned integer that is equivalent to .

  The 32-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified 64-bit signed integer to an equivalent 32-bit unsigned integer.

  A 32-bit unsigned integer that is equivalent to .

  The 64-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  The return value is the result of invoking the method of the underlying type of .

  Converts the value of the specified object to a 32-bit unsigned integer.

  A 32-bit unsigned integer that is equivalent to , or 0 (zero) if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is less than .

  Converts the value of the specified 8-bit signed integer to the equivalent 32-bit unsigned integer.

  A 32-bit unsigned integer that is equivalent to .

  The 8-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified single-precision floating-point number to an equivalent 32-bit unsigned integer.

  , rounded to the nearest 32-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The single-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  Using the method is equivalent to passing to the method. is interpreted by using the formatting conventions of the current thread culture.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 32-bit unsigned integer.

  A 32-bit unsigned integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 16-bit unsigned integer to the equivalent 32-bit unsigned integer.

  A 32-bit unsigned integer that is equivalent to .

  The 16-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  This method is provided for completeness.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Returns the specified 32-bit unsigned integer; no actual conversion is performed.

  is returned unchanged.

  The 32-bit unsigned integer to return. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than .

  Converts the value of the specified 64-bit unsigned integer to an equivalent 32-bit unsigned integer.

  A 32-bit unsigned integer that is equivalent to .

  The 64-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 `` ``

  The return value is the result of invoking the method of the underlying type of .

  enables the user to specify culture-specific conversion information about the contents of . For example, if is a that represents a number, could supply culture-specific information about the notation used to represent that number.

  The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to a 32-bit unsigned integer, using the specified culture-specific formatting information.

  A 32-bit unsigned integer that is equivalent to , or zero if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 `` `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  The return value is the result of invoking on .

  is an instance that obtains a object. The object provides culture-specific information about the format of . If is null, the for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 32-bit unsigned integer, using the specified culture-specific formatting information.

  A 32-bit unsigned integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt32 `` ``

  If is 16, you can prefix the number specified by the parameter with "0x" or "0X".

  Because the data type supports unsigned values only, the method assumes that is expressed using unsigned binary representation. In other words, all 32 bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed integer value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x80000000 converts to 2147483648."

  code reference: System.Convert.BaseConversion#13

  When performing binary operations or numeric conversions, it is always the responsibility of the developer to verify that a method or operator is using the appropriate numeric representation to interpret a particular value. The following example illustrates one technique for ensuring that the method does not inappropriately use binary representation to interpret a value that uses two's complement representation when converting a hexadecimal string to a value. The example determines whether a value represents a signed or an unsigned integer while it is converting that value to its string representation. When the example converts the value to a value, it checks whether the original value was a signed integer. If so, and if its high-order bit is set (which indicates that the original value was negative), the method throws an exception.

  code reference: System.Convert.BaseConversion#14

  Converts the string representation of a number in a specified base to an equivalent 32-bit unsigned integer.

  A 32-bit unsigned integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. The base of the number in , which must be 2, 8, 10, or 16.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the specified Boolean value to the equivalent 64-bit unsigned integer.

  The number 1 if is true; otherwise, 0.

  The Boolean value to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 8-bit unsigned integer to the equivalent 64-bit unsigned integer.

  A 64-bit signed integer that is equivalent to .

  The 8-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified Unicode character to the equivalent 64-bit unsigned integer.

  A 64-bit unsigned integer that is equivalent to .

  The Unicode character to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 `` To be added.

  Calling this method always throws .

  This conversion is not supported. No value is returned.

  The date and time value to convert.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified decimal number to an equivalent 64-bit unsigned integer.

  , rounded to the nearest 64-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The decimal number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified double-precision floating-point number to an equivalent 64-bit unsigned integer.

  , rounded to the nearest 64-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The double-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is less than .

  Converts the value of the specified 16-bit signed integer to the equivalent 64-bit unsigned integer.

  A 64-bit unsigned integer that is equivalent to .

  The 16-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is less than .

  Converts the value of the specified 32-bit signed integer to an equivalent 64-bit unsigned integer.

  A 64-bit unsigned integer that is equivalent to .

  The 32-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is less than .

  Converts the value of the specified 64-bit signed integer to an equivalent 64-bit unsigned integer.

  A 64-bit unsigned integer that is equivalent to .

  The 64-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  The return value is the result of invoking the method of the underlying type of .

  Converts the value of the specified object to a 64-bit unsigned integer.

  A 64-bit unsigned integer that is equivalent to , or zero if is null.

  An object that implements the interface, or null.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  value is less than .

  Converts the value of the specified 8-bit signed integer to the equivalent 64-bit unsigned integer.

  A 64-bit unsigned integer that is equivalent to .

  The 8-bit signed integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  Prior to the conversion, if is halfway between two whole numbers, it is rounded to the nearest even integer. For example, 4.5 is rounded to 4, and 5.5 is rounded to 6.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  is greater than or less than .

  Converts the value of the specified single-precision floating-point number to an equivalent 64-bit unsigned integer.

  , rounded to the nearest 64-bit unsigned integer. If is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6.

  The single-precision floating-point number to convert. 1 ExtendedNumerics
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 `` is null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  Using the method is equivalent to passing to the method. is interpreted by using the formatting conventions of the current thread culture.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 64-bit unsigned integer.

  A 64-bit signed integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 16-bit unsigned integer to the equivalent 64-bit unsigned integer.

  A 64-bit unsigned integer that is equivalent to .

  The 16-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Converts the value of the specified 32-bit unsigned integer to an equivalent 64-bit unsigned integer.

  A 64-bit unsigned integer that is equivalent to .

  The 32-bit unsigned integer to convert. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 ``

  This method is provided for completeness.

  This member is not CLS-compliant. For a CLS-compliant alternative, use ().

  Returns the specified 64-bit unsigned integer; no actual conversion is performed.

  is returned unchanged.

  The 64-bit unsigned integer to return. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 `` ``

  The return value is the result of invoking the method of the underlying type of .

  enables the user to specify culture-specific conversion information about the contents of . For example, if is a that represents a number, could supply culture-specific information about the notation used to represent that number.

  The base types ignore ; however, the parameter may be used if is a user-defined type that implements the interface.

  Converts the value of the specified object to a 64-bit unsigned integer, using the specified culture-specific formatting information.

  A 64-bit unsigned integer that is equivalent to , or zero if is null.

  An object that implements the interface. An object that supplies culture-specific formatting information.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 `` `` is a null reference. cannot be converted to a numeric value. The numeric value of is greater than or less than .

  The return value is the result of invoking on .

  is an implementation that obtains a object. The object provides culture-specific information about the format of . If is null, the object for the current culture is used.

  If you prefer not to handle an exception if the conversion fails, you can call the method instead. It returns a value that indicates whether the conversion succeeded or failed.

  Converts the specified string representation of a number to an equivalent 64-bit unsigned integer, using the specified culture-specific formatting information.

  A 64-bit unsigned integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. An object that supplies culture-specific formatting information. 0
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.UInt64 `` ``

  If is 16, you can prefix the number specified by the parameter with "0x" or "0X".

  Because the data type supports unsigned values only, the method assumes that is expressed using unsigned binary representation. In other words, all 64 bits are used to represent the numeric value, and a sign bit is absent. As a result, it is possible to write code in which a signed long integer value that is out of the range of the data type is converted to a value without the method throwing an exception. The following example converts to its hexadecimal string representation, and then calls the method. Instead of throwing an exception, the method displays the message, "0x8000000000000000 converts to 9223372036854775808."

  code reference: System.Convert.BaseConversion#15

  When performing binary operations or numeric conversions, it is always the responsibility of the developer to verify that a method or operator is using the appropriate numeric representation to interpret a particular value. The following example illustrates one technique for ensuring that the method does not inappropriately use binary representation to interpret a value that uses two's complement representation when converting a hexadecimal string to a value. The example determines whether a value represents a signed or an unsigned integer while it is converting that value to its string representation. When the example converts the value to a value, it checks whether the original value was a signed integer. If so, and if its high-order bit is set (which indicates that the original value was negative), the method throws an exception.

  code reference: System.Convert.BaseConversion#16

  Converts the string representation of a number in a specified base to an equivalent 64-bit unsigned integer.

  A 64-bit unsigned integer that is equivalent to the number in , or 0 (zero) if is null.

  A string that contains the number to convert. The base of the number in , which must be 2, 8, 10, or 16.
0