# Conversions Between Strings and Other Types (Visual Basic)

You can convert a numeric, Boolean, or date/time value to a String. You can also convert in the reverse direction — from a string value to numeric, Boolean, or Date — provided the contents of the string can be interpreted as a valid value of the destination data type. If they cannot, a run-time error occurs.

The conversions for all these assignments, in either direction, are narrowing conversions. You should use the type conversion keywords (CBool, CByte, CDate, CDbl, CDec, CInt, CLng, CSByte, CShort, CSng, CStr, CUInt, CULng, CUShort, and CType). The Format and Val functions give you additional control over conversions between strings and numbers.

If you have defined a class or structure, you can define type conversion operators between String and the type of your class or structure. For more information, see How to: Define a Conversion Operator.