Find-String
Command Description
Find the specified characters in the string; return the position of the found characters if found, and return 0 if not found
Command Prototype
iRet = InStr(sText,sSubText,iPos,bCompare)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
sText | True | string | "" | The string to be operated |
sSubText | True | string | "" | The substring to find |
iPos | True | number | 1 | The index of position to start finding |
bCompare | True | boolean | None | Whether to be case sensitive when strings are compared |
return
iRet,The variable used to save the output of the command.
Demo
TracePrint("----------------------find string---------------------- --")
//-------------------------------------------------------------------------------
//[Remarks] Find the specified character in the string, return the position of the found character, if not found, return 0.
//Input parameter 1:
// sText--A string to operate on.
//Input parameter 2:
// sSubText--the substring to be searched.
//Input parameter 3:
// iPos--Search from the first word.
//Input parameter 4:
// bCompare--Whether it is case sensitive when comparing strings.
//out parameters:
// iRet--The variable to which the output of the function call is saved.
//
//Command prototype: iRet=InStr(sText,sSubText,iPos,bCompare)
//-------------------------------------------------------------------------------
iRet=InStr("UiBot", "Bot",1,True)
TracePrint(iRet)