Try this piece'o'code...
Enjoy!Code:Private Sub Form_Load() Dim TestString As String TestString = "This is a line " & vbTab & "with some 'hollow boxes'" & vbCrLf & " wich will be stripped soon..." TestString = ETrim(TestString) End Sub Public Function ETrim(S As String) As String 'ETrim trims all "unknown chars" etc.. from a string Dim T As Integer Dim TmpS As String TmpS = "" ' Clear Temporary String For T = 1 To Len(S) ' Check all the in-string If Asc(Mid(S, T, 1)) >= 32 Then TmpS = TmpS + Mid(S, T, 1) ' no weird stuff? Then add it to TmpS Next T ETrim = TmpS ' And return the value End Function




Reply With Quote