|
|
VBScript CStr Function
Complete VBScript Reference
The CStr function converts an expression to type String.
Syntax
| Parameter |
Description |
| expression |
Required. Any valid expression If expression is:
- Boolean - then the CStr function will return a string containing true
or false.
- Date - then the CStr function will return a string that contains a
date in the short-date format.
- Null - then a run-time error will occur.
- Empty - then the CStr function will return an empty string ("").
- Error - then the CStr function will return a string that contains the
word "Error" followed by an error number.
- Other numeric - then the CStr function will return a string that
contains the number.
|
Example 1
Dim a
a=False
document.write(CStr(a))
Output:
False
|
Example 2
Dim a
a=#01/01/01#
document.write(CStr(a))
Output:
1/1/2001
|
Complete VBScript Reference
|
|
|