Function String Manipulations Class

RepeatStringCharacters

Creates a string by repeating each of the characters in vStringChars. Each character within vStringChars is repeated the specified number of times before the succeeding character is repeated.

Signature (Visual Basic / VBA)

Public Function RepeatStringCharacters( _
      ByVal vStringChars As Variant _
    , Optional ByVal vNTimes As Variant _
    ) As Variant

Code Example

    RepeatStringCharacters("ABCD", 3) = "AAABBBCCCDDD"

Parameters

Parameter Description
vStringChars The string containing the characters which are to be replicated. Function returns Null if vStringChars is Null or cannot be fixed up to a String.
vNTimes The number of times that each character within string vStringChars is to be replicated. vNTimes defaults to 1 (one) if it is missing or Null or cannot be fixed up to a number. Function returns an empty string if vNTimes is <= 0 (less than or equal to zero).