Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

VBScript CStr function


May 13, 2021 VBScript


Table of contents


VBScript CStr function

The VBScript CStr function is used to return an expression that has been converted to a Variant of the String sub-type.


VBScript CStr function Complete VBScript reference manual

The CStr function converts the expression to a string type.

Grammar

CStr(expression)

Parameters

parameter describe
expression Required.Any effective expression.

If the expression is:

  • The Boolean - The CSTR function will return a string in which True or False is included.
  • The DATE - CSTR function will return a string that contains the date of the short date format.
  • NULL - Run-Time error will occur.
  • The EMPTY - CSTR function will return an empty string ("").
  • The ERROR - the CSTR function will return a string that contains the word "error" and the error number.
  • The Other Numeric - The CSTR function will return a string that contains numbers.
<script type="text/vbscript">

document.write(CStr("300000") & "<br />")
document.write(CStr(#10-05-25#) & "<br />")

</script>

The above example output results:

300000
10/5/2025

Try it out . . .

VBScript CStr function Complete VBScript reference manual