The following table lists the Visual Basic data type conversion functions.
Function | Converts To |
---|---|
CBool | Boolean |
CByte | Byte |
CChar | Char |
CDate | Date |
CDbl | Double |
CDec | Decimal |
CInt | Integer |
CLng | Long |
CObj | Object |
CSByte | SByte |
CShort | Short |
CSng | Single |
CStr | String |
CUInt | UInteger |
CULng | ULong |
CUShort | UShort |
Remember that data types have their own parsing methods in addition to these data type conversion functions. For example, the following code converts the String variable a_string into an Integer value:
an_integer = Integer.Parse(a_string)
These methods are faster than the corresponding data type conversion function (in this case, CInt).