How to trim characters from the End of a string
Posted on January 4, 2009
1 2 3 4 5 6 7 8 9 10 11 12 | 'String Manipulation - How to trim characters from the End of a string Option Explicit Public Function RTrimChar(ByVal Expression As String, Optional ByVal sTrimChar As String = " ") _ As String Dim iLength As Integer iLength = Len(sTrimChar) Do While (Right$(Expression, iLength) = sTrimChar) Expression = Mid$(Expression, 1, Len(Expression) - iLength) Loop RTrimChar = Expression End Function |