Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Split Version 6 (Java)

Группа действий: Работа с текстом

Описание

Преобразует текст в коллекцию строк по заданному разделителю.

Иконка

Image Removed

Параметры

Входные параметры  

Текст                               Исходный текст для обработки.

Разделитель                   Символ или текст, который определяет конец строки.

Удалить пустые              Удалить пустые значения из выходной коллекции.

Выходные параметры

Результат Результирующая коллекция строк.

Настройки

...

Свойство

...

Англ. наименование

...

Описание

...

Тип

...

Исходный текст для обработки.

...

Символ или текст, который определяет конец строки.

Для обозначения переноса строки применяется "\r\n"

По умолчанию пробел.

...

Удалить пустые значения из выходной коллекции.

По умолчанию false.

...

Логический

...

Особые условия использования

Отсутствуют.

Пример использования 

Задача

Существует переменная "Вводный текст" со значением = "Робот 1. Робот 2. Робот 3." Необходимо преобразовать текст в коллекцию строк по разделителю "." и вывести полученные значения последовательно в диалоговых окнах. 

Решение

Воспользоваться действиями "Разделить", "Получить значение по индексу" "Сообщение". 

Релизация

...

Action group: Text

...

Description

Converts text into a collection of strings by a specified delimiter

Action icon

Image Added

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
TextText to make action onRobin.String
Yes
SeparatorA symbol or string that delimits the substrings in the given string. Space by default.Robin.String
No
Remove empty entriesIf the parameter value is true, then the action will omit empty values from the output collection. The default is false.Robin.BooleantrueNo
Results
ResultThe resulting collection of stringsRobin.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

  1. Create a variable of the collection type to record the result of the "Split" action into it. 
    Image Added

  2. Move the "Split" action to the workspace and set its parameters. 
    Image Added

  3. Move the "Get value by index" action to the workspace and set its parameters. 
    Image Added

  4. Move the "Show message" action to the workspace and set its parameters.
    Image Added

  5. Repeat steps 3 and 4 for values with indexes 1 and 2. 

  6. Launch the robot using the "Start" button in the top panel. 

Result 

3 dialog boxes are displayed sequentially 

Результат 

Последовательно выведены 3 диалоговых окна