|
|
CODE ' Code courtesy of UtterAccess Wiki ' http://www.utteraccess.com/wiki/index.php/Category:FunctionLibrary ' ' You are free to use this code in any application, ' provided this notice is left unchanged. ' ' REV DATE DESCRIPTION ' 1.0 2010-Oct-3 initial release ' 1.1 2011-Mar-30 Optimized. '===================================================================== 'This function will right pad a string with a specified 'character. It accepts a base string which is to be right padded with 'characters, a character to be used as the pad character, and a 'length which specifies the total length of the padded result. '===================================================================== Function Rpad(MyValue As String, MyPadCharacter As String, MyPaddedLength As Integer) As String If Len(MyValue) < MyPaddedLength And Len(MyPadCharacter) > 0 Then Rpad = Left(MyValue & String(MyPaddedLength, MyPadCharacter), MyPaddedLength) Else Rpad = MyValue End If End Function see also: LPad
|
| This page was last modified 08:54, 6 April 2011. This page has been accessed 1,616 times. Disclaimers |