O'Reilly logo

A Programmer's Guide to .NET by Alexei Fedorov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

3.6. Conversions with the System.Convert class

The System.Convert class is used to perform various conversions. Using this class we can perform narrow conversions and conversions to unrelated data types. The following is a list of supported conversions:

  • we can convert between Byte, SByte, Int16, Int32, Int64, UInt16, UInt32, UInt64, Single, Double, Decimal, String, and Object;

  • we can convert from Char to Int32, UInt32, String, and Object;

  • Byte, SByte, Int16, Int32, UInt16, UInt32, and String can be converted to Char;

  • we can convert from Boolean to Byte, Char, Int16, Int32, Int64, UInt16, UInt32, UInt64, String, and Object;

  • Byte, SByte, Int16, Int32, Int64, UInt16, UInt32, UInt64, and String can be converted to Boolean;

  • DateTime can be converted to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required