IfInString / IfNotInString
IfInString, 變數 , 搜尋字串
IfNotInString, 變數 , 搜尋字串
檢查[變數]裡是否含有[搜尋字串]
只能檢查單一字串, 要檢查多字串要用 if Var contains MatchList
Example
Haystack = abcdefghijklmnopqrs
Needle = abc
IfInString, Haystack, %Needle%
{
MsgBox, The string was found.
return
}
else
Sleep, 1
-以下為原文-
IfInString / IfNotInString
Checks if a variable contains the specified string.
IfInString, var, SearchString
IfNotInString, var, SearchString
Position := InStr(Haystack, Needle [, CaseSensitive?, StartingPos]]) ; See the InStr() function for details.
Parameters
| var | The name of the variable whose contents will be searched for a match. |
| SearchString | The string to search for. Matching is not case sensitive unless StringCaseSense has been turned on. |
請先 登入 以發表留言。