Here's an example of the use of the strGetWhiteSpace function.


<pre>Public Function strTrim(ByVal MyStr As String, strWhiteSpace As String) As String
' Procedure : strTrim
' Description: Remove user-nominated space from both ends of a string.
' Copyright: Chris Greaves Inc.
' Inputs: Data string, string of white-space characters
' Returns: Original string with white space removed.
' Assumes: None.
' Side Effects: None
' Tested: By the calls shown below.
While Len(MyStr) > 0 And InStr(1, strWhiteSpace, Left(MyStr, 1))
MyStr = Right(MyStr, Len(MyStr) - 1)
Wend
While Len(MyStr) > 0 And InStr(1, strWhiteSpace, Right(MyStr, 1))
MyStr = Left(MyStr, Len(MyStr) - 1)
Wend
strTrim = MyStr
'Sub TESTstrTrim()
'MsgBox "+" & strTrim(" abc ", Chr$(32) & Chr$(9) & Chr$(160)) & "+"
'MsgBox "+" & strTrim(" abc ", Chr$(9) & Chr$(160)) & "+"
'MsgBox "+" & strTrim(" abc ", "") & "+"
'End Sub
End Function
</pre>