Skip to main content
Version: v6.5.0

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​

ParameterRequiredTypeDefaultDescription
sTextTruestring""The string to be operated
sSubTextTruestring""The substring to be found
iPosTruenumber1The index of position to start finding
bCompareTruebooleanNoneWhether 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)