String-Starts-with
Command Description
Determine if a string starts with a given substring
Command Prototype
bRet = StartsWith(sText,sStartsStr)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
sText | True | string | "" | The target string to be determined |
sStartsStr | True | string | "" | The specified prefix strings |
return
bRet,The variable used to save the output of the command.
Demo
TracePrint("----------------------Judgment starts with the specified prefix-------------------- ----")
//-------------------------------------------------------------------------------
//[Remarks] Determine whether the target string starts with the specified prefix, if it starts with the specified prefix, return true, otherwise return false.
//Input parameter 1:
// sText--The target string to be judged.
//Input parameter 2:
// sStartsStr--Specified prefix string.
//out parameters:
// bRet--The variable to which the output of the function call is saved.
//
//Command prototype: bRet=StartsWith(sText,sStartsStr)
//-------------------------------------------------------------------------------
bRet=StartsWith("UiBot","Ui")
TracePrint(bRet)