📅  最后修改于: 2022-03-11 14:51:55.803000             🧑  作者: Mango
Option Explicit
Function trimWhiteSpace(s As String) As String
Dim RE As Object: Set RE = CreateObject("vbscript.regexp")
With RE
.Global = True
.MultiLine = True
.Pattern = "^\s*(\S.*\S)\s*"
trimWhiteSpace = .Replace(s, "$1")
End With
End Function