Format-String
Command Description
Support formatting strings with placeholder
Command Prototype
sRet = Format(sText,repText1,repText2)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
sText | True | string | "%d %s" | Strings containing placeholders follow the rules of the C library command sprintf: %[flags][width][.precision][length]specifier, but *, h, L, l, n, and p are not supported; "%q" is newly added to encapsulate the target string with double quotation marks; "%%" means "escape", and cannot work as a placeholder |
repText1 | True | number | 1 | Only one replacement value can be entered, and the sequence directly corresponds to the sequence of placeholders in the format string |
repText2 | True | string | "Laiye RPA" | Only one replacement value can be entered, and the sequence directly corresponds to the sequence of placeholders in the format string |
return
sRet,The variable used to save the output of the command.
Demo
TracePrint("----------------------Format string---------------------- ---")
//-------------------------------------------------------------------------------
//[Remarks] Supports formatting strings in the form of placeholders.
//Input parameter 1:
// sText--A string containing placeholders.
//Input parameter 2:
// repText1--A replacement value corresponding to the sequence of placeholders in the format string.
//Input parameter 3:
// repText2--a replacement value corresponding to the sequence of placeholders in the format string.
//out parameters:
// sRet--The variable to which the output of the function call is saved.
//
//Command prototype: sRet=Format(sText,repText1,repText2)
//-------------------------------------------------------------------------------
sRet = Format ("UiBot%d%s", 1, "Laiye RPA")
TracePrint (sRet)