Public Function RepeatString( _ ByVal vRepetitions As Variant _ , ByVal vRepeat As Variant _ ) As Variant
RepeatString(3, "ABC") = "ABCABCABC" whereas String$(3, "ABC") = "AAA"Example:
RepeatString(3, 65) = "AAA" assuming Chr$(65) = "A" Asc("A") = 65See also:
RepeatStringToLength Function RepeatStringCharacters Function String$ Function (Visual Basic)Similar to the RepeatStringCharacters function, except that RepeatStringCharacters repeats each of the characters within a string.
vRepetitions: The number of times that the string or character vRepeat is to be repeated. Function returns Null if vRepetitions is Null or cannot be fixed up to a number.
vRepeat: The string or character which is to be replicated. Note: Special argument fix-up code.
Function returns an empty string if vRepeat is an empty string.
If vRepeat is a string, the entire string is repeated the specified number of times.
If vRepeat is numeric, the string is constructed from the character with that ASCII value.
Function returns Null if vRepeat is neither string nor numeric.
Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.