Trim leading spaces including tabs

后端 未结 4 997
醉酒成梦
醉酒成梦 2020-12-19 13:20

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

4条回答
  •  星月不相逢
    2020-12-19 14:03

    This function removes all leading whitespace (spaces, tabs etc) from a string:

    Function LTrimEx(str)
      Dim re
      Set re = New RegExp
      re.Pattern = "^\s*"
      re.Multiline = False
      LTrimEx = re.Replace(str, "")
    End Function
    

提交回复
热议问题