Home > Language Reference > Functions > Data Types

CStr Function

Conversion into a String type.

Syntax

CStr( Expression )

ParameterDescription
ExpressionExpression to convert into a String type.

Remarks

The CStr reserved keyword is syntactically equivalent to a function returning a String type, and can be used everywhere that a function is accepted.

All data types can be converted into a string except non-initialized Variant and object references.

When Expression is a numeric value, the resulting string does not contain thousands separators, and the decimal separator is a decimal point. On the other hand, when Expression is a date, the conversion takes localization into account. In both cases, you can use the Format function if you want to have better control over the format obtained.

When Expression is a boolean value, the result is one of the two strings "True" or "False".

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0-
Windows CEWindows CE 3.0-