Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

VBScript CStr Function

VBScript CStr Function


VBScript reference manual Complete VBScript Reference Manual


The CStr function converts an expression to the String type.

Syntax

CStr(expression)

Parameters Description
expression Required. Any valid expression.

If the expression is:

  • Boolean - The CStr function returns a string containing true or false.
  • Date - The CStr function returns a string containing the date in short date format.
  • Null - A run-time error occurs.
  • Empty - The CStr function returns an empty string ("").
  • Error - The CStr function returns a string containing the word "Error" and the error number.
  • Other numeric - The CStr function returns a string containing the number.
  • |

    Example

    Example

    The example above produces the following output:

    300000

    10/5/2025

    Try it »


    VBScript reference manual Complete VBScript Reference Manual