How to trim characters from the Beginning 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 Beginning of a string Option Explicit Public Function LTrimChar(ByVal Expression As String, Optional ByVal sTrimChar As String = " ") _ As String Dim iLength As Integer iLength = Len(sTrimChar) Do While (Left$(Expression, iLength) = sTrimChar) Expression = Mid$(Expression, iLength + 1) Loop LTrimChar = Expression End Function |