>I'm looking for a 2 functions, 1 to Replicate a string a specific number of times and the other to pad a string. eg:
>?Replicate("X",5) 'Prints "XXXXX"
>?Pad("X",5,"O") 'Prints "XOOOO"
>
>These are easy enough to build but I am wondering if there are some built-in functions that I am missing.
You can use this custom-made Pad function:
Public Function Pad(ByVal pstrSource As String, _
ByVal pstrFiller As String, _
ByVal pintLen As Integer) As String
Pad = Left$(Trim$(pstrSource) & String$(pintLen, pstrFiller), pintLen)
End Function
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com