VBScript String function
String function returns a string that contains the specified length of the duplicate characters.
grammar
String(number,character)
参数 | 描述 |
---|---|
number | 必需。被返回字符串的长度。 |
character | 必需。被重复的字符。 |
Example 1
document.write(String(10,"#"))
Output:
##########
Output:
##########
Example 2
document.write(String(4,"*"))
Output:
****
Output:
****
Example 3
document.write(String(4,42))
Output:
****
Output:
****
Example 4
document.write(String(4,"XYZ"))
Output:
XXXX
Output:
XXXX
Complete VBScript Reference