Skip to main content

String-Comparision

Command Description

Compare two strings, return true if they are identical, and return false otherwise

Command Prototype

bRet = StrComp(s1,s2,bCompare)

Parameter Description

ParameterRequiredTypeDefaultDescription
s1Truestring""The first string to be compared
s2Truestring""The second string to be compared
bCompareTruebooleanNoneWhether to be case sensitive when strings are compared

return

bRet,The variable used to save the output of the command.

Demo

TracePrint("----------------------String comparison---------------------- --") 
//-------------------------------------------------------------------------------
//[Remarks] Compare two strings, return true if the strings are the same, and return false if they are not.
//Input parameter 1:
// s1--The first string to compare.
//Input parameter 2:
// s2--The second string to compare.
//Input parameter 3:
// bCompare--Whether it is case sensitive when comparing strings.
//out parameters:
// bRet--The variable to which the output of the function call is saved.
//
//Command prototype: bRet=StrComp(s1,s2,bCompare)
//-------------------------------------------------------------------------------
bRet=StrComp("UiBot","Ui",True)
TracePrint(bRet)