Find-String-Reversed
Command Description
Find the specified characters in the string in reversed order; return the position of the found characters if found, and return 0 if not found
Command Prototype
iRet = InStrRev(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 be found |
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("----------------------Search strings in reverse order--------------------- ---")
//-------------------------------------------------------------------------------
//[Remarks] Find the specified character in the string, return the position of the found character, if not found, return 0, search in reverse order.
//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=InStrRev(sText,sSubText,iPos,bCompare)
//-------------------------------------------------------------------------------
iRet= InStrRev("UiBot", "Bot",1,True)
TracePrint(iRet)