Export (0) Print
Expand All

Character Data Types 

Visual Basic provides character data types for dealing with printable and displayable characters. While they both deal with Unicode characters, Char holds a single character while String contains an indefinite number of characters.

For a table showing a side-by-side comparison of the Visual Basic data types, see Data Type Summary (Visual Basic).

Char Type

The Char data type is a single two-byte (16-bit) Unicode character. If a variable always stores exactly one character, declare it as Char.

For more information, see Char Data Type (Visual Basic).

String Type

The String data type is a sequence of zero or more two-byte (16-bit) Unicode characters. If a variable can contain an indefinite number of characters, declare it as String.

For more information, see String Data Type (Visual Basic).

See Also

Community Additions

ADD
Show:
© 2014 Microsoft