Method: String for VBS
- Updated2024-09-12
- 1 minute(s) read
Methods > Method: String for VBS
Method: String for VBS
Generates a text with one or more recurring characters.
vstring = Object.String([number], [character])
| Object | VBS Object with this method. You do not need to specify this object. |
| [number] | Variant Specifies the length of the returned text. |
| [character] | Variant Specifies a character code or a text whose first character repeats the method. |
| vstring | Variant Receives the text of the given length with a recurring character. |
The following example generates a text that contains the character A five times:
Dim MyString MyString = String(5, "A") Call MsgBox(MyString) ' Returns "AAAAA" MyString = String(5, 65) Call MsgBox(MyString) ' Returns "AAAAA" MyString = String(5, "ABC") Call MsgBox(MyString) ' Returns "AAAAA"