История страницы
...
Split Version 6 (Java)
Группа действий: Работа с текстом
Описание
Преобразует текст в коллекцию строк по заданному разделителю.
Иконка
Параметры
Входные параметры
Текст Исходный текст для обработки.
Разделитель Символ или текст, который определяет конец строки.
Удалить пустые Удалить пустые значения из выходной коллекции.
Выходные параметры
Результат Результирующая коллекция строк.
Настройки
...
Свойство
...
Англ. наименование
...
Описание
...
Тип
...
Исходный текст для обработки.
...
Символ или текст, который определяет конец строки.
Для обозначения переноса строки применяется "\r\n"
По умолчанию пробел.
...
Удалить пустые значения из выходной коллекции.
По умолчанию false.
...
Логический
...
Особые условия использования
Отсутствуют.
Пример использования
Задача
Существует переменная "Вводный текст" со значением = "Робот 1. Робот 2. Робот 3." Необходимо преобразовать текст в коллекцию строк по разделителю "." и вывести полученные значения последовательно в диалоговых окнах.
Решение
Воспользоваться действиями "Разделить", "Получить значение по индексу" "Сообщение".
Релизация
...
Action group: Text
...
Description
Converts text into a collection of strings by a specified delimiter
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Text | Text to make action on | Robin.String | Yes | |
Separator | A symbol or string that delimits the substrings in the given string. Space by default. | Robin.String | No | |
Remove empty entries | If the parameter value is true, then the action will omit empty values from the output collection. The default is false. | Robin.Boolean | true | No |
Results | ||||
Result | The resulting collection of strings | Robin.Collection |
Special conditions of use
None.
Example of use
Task
There is a variable "Introductory text" with value = "Robot 1. Robot 2. Robot 3." It is necessary to convert the text into a collection of strings by delimiter "." and output the obtained values sequentially in dialog boxes.
Solution
Use the actions "Split", "Get value by index" "Show message".
Implementation
- Create a variable of the collection type to record the result of the "Split" action into it.
- Move the "Split" action to the workspace and set its parameters.
- Move the "Get value by index" action to the workspace and set its parameters.
- Move the "Show message" action to the workspace and set its parameters.
- Repeat steps 3 and 4 for values with indexes 1 and 2.
- Launch the robot using the "Start" button in the top panel.
Result
3 dialog boxes are displayed sequentially
Результат
Последовательно выведены 3 диалоговых окна