使用 Trim 獲取字串的副本,不帶任何前導或尾隨空格
'Trim the leading and trailing spaces in a string
Const paddedText As String = " Foo Bar "
Dim trimmedText As String
trimmedText = Trim$(paddedText)
'trimmedText = "Foo Bar"
'Trim the leading and trailing spaces in a string
Const paddedText As String = " Foo Bar "
Dim trimmedText As String
trimmedText = Trim$(paddedText)
'trimmedText = "Foo Bar"