STRING(number, character)

Returns a repeating character of a given length (String).

numberThe length of the returned string (Long)
characterThe character code specifying the character or string expression whose first character is used to build the return string (Variant)

* If "number" > 256, then the number used is "character" Mod 256.
* If "number" is Null, then Null is returned.
* If "character" is a number, then it is converted to a character.
* If "character" < 0, then
* If "character" > 0 and "character" < 255, then
* If "character" > 255, then
* If "character" is Null, then Null is returned
* You can use the STR function to return the text string of a number.
* You can use the STRREVERSE function to return the text string with the characters reversed.
* You can use the STRING$ function to return a String data type instead of a Variant/String data type.
* For the Microsoft documentation refer to

String(5,"a") = "aaaaa" 
String(2,abcd"0 = "aa"
String(3,"abcd") = "aaa"
String(4,"b") = "bbbb"
String(5,40) = "((((("
String(5,80) = "PPPPP"
String(5,"") - run time error

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited Top