I need to read files using vbscript and remove all leading spaces including any tabs. I now LTRIM will remove the leading spaces but how do I remove tabs also.
Thank
For a both left and right trim (including tabs, carriage return, line feeds, spaces) in a multiline string this will work.
Function MultilineTrim (Byval TextData)
Dim textRegExp
Set textRegExp = new regexp
textRegExp.Pattern = "\s{0,}(\S{1}[\s,\S]*\S{1})\s{0,}"
textRegExp.Global = False
textRegExp.IgnoreCase = True
textRegExp.Multiline = True
If textRegExp.Test (TextData) Then
MultilineTrim = textRegExp.Replace (TextData, "$1")
Else
MultilineTrim = ""
End If
End Function