VBScript String Function
Definition and Usage
The String function can return a string containing a specified length of repeated characters.
Syntax
String(number,character)
Parameter | Description |
---|---|
number | Required. The length of the returned string. |
character | Required. The repeated characters. |
Instance
Example 1
document.write(String(10,"#"))
Output:
##########
Example 2
document.write(String(4,"*"))
Output:
****
Example 3
document.write(String(4,42))
Output:
****
Example 4
document.write(String(4,"XYZ"))
Output:
XXXX