使用 InStr 确定字符串是否包含子字符串
Const baseString As String = "Foo Bar"
Dim containsBar As Boolean
'Check if baseString contains "bar" (case insensitive)
containsBar = InStr(1, baseString, "bar", vbTextCompare) > 0
'containsBar = True
'Check if baseString contains bar (case insensitive)
containsBar = InStr(1, baseString, "bar", vbBinaryCompare) > 0
'containsBar = False