История страницы
Composite
...
formatting Version 6 (Java)
Action group: Text
...
Description
Replaces one or more format elements in a string with a string representation of the specified object.
Action icon
Settings of parameters
Property |
Description |
Type |
Тип
Filling example | Mandatory field | |||
Parameters | ||||
Composite format string |
Строка, в которой места для подстановки текста обозначены как {x}, где х - порядковый номер объекта в коллекции.
A string in which places for text substitution are denoted as {x}, where x is the ordinal number of the object in the collection. | Robin.String | Yes | |
Object collection to format |
Коллекция объектов, текстовое представление которых заменит в указанной строке обозначения вида {x} в соответствии с их порядковыми номерами.
Нумерация начинается с 0.
Коллекция
0:Грека, 1: реку, 2:рак, 3: реке
Строковая переменная, содержащая результат подстановки указанных объектов.
A collection of objects, the textual representation of which will replace symbols of the form {x} in the specified string in accordance with their ordinal numbers. Numbering starts from 0. | Robin.Collection | Yes | ||
Results | ||||
Result | String variable containing the result of substitution of the specified objects | Robin.String |
Special conditions of use
If the formatting elements in a string do not have a corresponding numbered element in the object collection, an error will occur.
Example of use
Task
There is a variable "Collection" with values:
0:Greek, 1: river, 2:cancer, 3: river.
Substitute the elements of the collection into the text: driving ? through ?, sees ? in ? ?
Solution
Use the "Composite formatformatting", "Show message" actions.
Implementation
- Create a string type variable "Text" where the "Composite formatformatting" action result will be written into.
- Move the "Composite formatformatting" action to the workspace and set its parameters.
- Move the "Show message" action to the workspace and set its parameters.
- Click "Start" in the top panel to start the robot.
Result
The formatted text was displayed in the dialogue window.