JustCode : Pad out a string with a x amount of characters

This JustCode script shows you how to pad out a string with a certain amount of text characters.

Function PAD(sString,iSize,sWith)
Dim iPos,sPad

For iPos = 1 To iSize
   sPad = sPad + sWith
Next

PAD = right(sPad + sString,iSize)
End Function

Leave a Comment