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.
創作者介紹
創作者 凱.喵.白日夢 的頭像
cary2004

凱.喵.白日夢

cary2004 發表在 痞客邦 留言(0) 人氣( 354 )