'我需要能够在 instr 函数中使用两个变量(字符串),但它不会返回正确的值,第一个示例是我需要的样式。但似乎无法让它工作。任何帮助将不胜感激。我已经为此工作了 3 天……它让我充满了愤怒。
Option Explicit
dim message, searchTerm, position
message = "bob dole was here"
searchTerm = "dole"
position = InStr(message, searchTerm)
'This always returns 0
position = InStr("bob dole was here", searchTerm)
'This returns 5, which is accurate
position = InStr(message, "dole")
'This returns 0,