VBScript String Function | Novice Tutorial
Novice Tutorial --
VBScript String Function
Complete VBScript Reference Manual
The String function returns a string containing a repeated character of a specified length.
Syntax
String(number,character)
Parameter
Description
number
Required. The length of the string to be returned.
character
Required. The character to be repeated.
Example 1
document.write(String(10,"#"))
Output:
##########
Example instruction 2
document.write(String(4,"*"))
Output:
****
Example instruction 3
document.write(String(4,42))
Output:
****
Example instruction 4
document.write(String(4,"XYZ"))
Output:
XXXX
VBScript String Function
Complete VBScript Reference Manual
The String function returns a string containing a repeated character of a specified length.
Syntax
String(number,character)
| Parameter | Description |
|---|---|
| number | Required. The length of the string to be returned. |
| character | Required. The character to be repeated. |
Example 1
document.write(String(10,"#"))
Output:
##########
Example instruction 2
document.write(String(4,"*"))
Output:
****
Example instruction 3
document.write(String(4,42))
Output:
****
Example instruction 4
document.write(String(4,"XYZ"))
Output:
XXXX
YouTip