String ($) Function Changes in Visual Basic
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

String ($) Function Changes in Visual Basic

Visual Basic .NET eliminates the need for some functions to have both a String version and a Variant version.

Visual Basic 6.0

In Visual Basic 6.0, some functions have two versions, one that returns a String value and one that returns a Variant value. These function pairs are differentiated by a dollar sign ($) suffix for the String version; for example, Chr and Chr$.

Visual Basic .NET

Visual Basic .NET replaces each function pair with a single function. The Variant versions are discontinued, and you can call the String versions either with or without the $ suffix.

Although only Trim is defined, Visual Basic .NET accepts Trim$ because the $ works as an identifier type character for the String data type.

See Also

Format Function Changes in Visual Basic | Date and Time Changes in Visual Basic | Programming Element Support Changes Summary | LTrim, RTrim, and Trim Functions

© 2015 Microsoft