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

Ключ

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

Convert the collection to the string Version 1 (Net)

...

Action group: Collections, subgroup: Arrays

...

...

Description

The action joints converts the collection elements to one string

Action icon

Image Modified

Parameters

Input parameters

  • The "Collection" field - the collection whose elements will be converted to a string
  • The "Separator" field - the character or characters that will separate the elements in the string

Output parameters

  • "Result" . Description: - the string with joined converted elements from the collection. Data type - Robin.String

...

Settings

...
PropertyDescriptionTypeFilling exampleMandatory field
Parameters
CollectionThe collection whose elements will be converted to a string
Robin.Collection
Yes
SeparatorThe character or characters that will separate the elements in the string
Robin.String
No
Results
ResultThe string with joined elements from the collection
Robin.String

Special conditions of use

  • The action can only merge convert collection items with the data types "String" or "NumberNumeric".
  • If there are no string/numeric elements in the collection, the action will return an empty string.
  • If the collection contains elements of other types besides string/numeric elements, the action will merge convert only string/numeric elements.
  • The user can enter character\/characters that will separate the elements in the string. Example: the elements of the collection are: "1", "2", "3", "а". Separator: "|". Result: string "1|2|3|a".
  • If the user does not set a separator, the elements in the string will go one after the other. Example: The elements of a collection are: "1", "2", "3", "а".  Result: string "123a".
  • If there is one string/numeric element in the collection, the action will return a string with one element. In this case, the set separator will not be taken into account.
  • Output the collection of whole numbers without zero (i.e., not "1.0" but "1").

Example of

...

use 

Task 1 

Joint Conversion without the separator. 

Solution

  1. Set the "Merge CollectionConvert the collection to the string" items action to the workspace.
  2. Set the parameters correctly: in the "Collection" parameter set the collection with several string or numeric elements, set the "Separator" as a character/characters. 
  3. Run the robot. 

Implementation

  1. Установить действие "Объединить элементы коллекции" на рабочую область.
  2. Корректно заполнить параметры: "Коллекция" - указать коллекцию с несколькими строковыми или числовыми элементами, "Разделитель" - не указывать.
  3. Запустить робота.

Image Removed

Image Removed

Image Removed

Image Removed

Результат: Действие вернуло строку со строковыми и числовыми элементами коллекции, которые разделены указанными символами\символом.

Задача 2:

Объединение с разделителем

Решение

  1. Установить действие "Объединить элементы коллекции" на рабочую область.
  2. Корректно заполнить параметры: "Коллекция" - указать коллекцию с несколькими строковыми или числовыми элементами, "Разделитель" - указать символ\символы.
  3. Запустить робота.

Реализация

  1. Повторить пункты 1-3 Задачи 1.
  2. Корректно заполнить параметры: "Коллекция" - указать коллекцию с несколькими строковыми или числовыми элементами, "Разделитель" - не указывать.

Результат: Действие вернуло строку с идущими друг за другом строковыми и числовыми элементами указанной коллекции.

 Image Removed

Задача 3:

Объединение коллекции без строковых\числовых элементов

Решение

  1. Установить действие "Объединить элементы коллекции" на рабочую область.
  2. Корректно заполнить параметры: "Коллекция" - указать коллекцию без строковых и числовых элементов, "Разделитель" - указать символ\символы.
  3. Запустить робота.

Реализация

  1. Повторить пункты 1-3 Задачи 1.
  2. В Параметрах «Коллекция» не указывать  тип  коллекции. Оставить не заполненным.

 Image Removed

Результат: Действие вернуло пустую строку.

Задача 4

Объединение коллекции с целыми числами

  1. Установить действие "Объединить элементы коллекции" на рабочую область.
  2. Корректно заполнить параметры: "Коллекция" - указать коллекцию с целыми числами.
  3. Запустить робота.

Реализация

  1. Повторить пункты 1-3 Задачи 1.
  2. Задать в коллекции элементы в виде целых чисел, с разрядом после запятой в виде нуля.

Image Removed

Результат: Действие вернуло строку с идущими друг за другом целыми числами. Нуль после целых чисел не записан.

Элементы коллекции: "10.0", "11.0". Результат: "1011".

  1. Set the "Convert the collection to the string" action to the workspace. 
  2. Set the parameters correctly: in the "Collection" field set the collection with several string or numeric elements, do not set the "Separator".
  3. Run the robot. 

Image Added


Image Added

Image Added


Image Added

Result

The action returned the string with string and numeric collection elements that were separated with the set character/characters. 

Task 2

Conversion with the separator

Solution

  1. Set the "Convert the collection to the string" action to the workspace. 
  2. Set the parameters correctly: in the "Collection" parameter set the collection with several string or numeric elements, set the "Separator" as a character/characters. 
  3. Run the robot. 

Implementation

  1. Repeat steps 1-3 of Task 1.
  2. Set the parameters correctly: in the "Collection" field set the collection with several string or numeric elements, do not set the "Separator".

Result

The action returned a string of consecutive string and numeric elements of the set collection.

Image Added

 Task 3

Conversion of the collection without string/numeric elements. 

Solution

  1. Set the "Convert the collection to the string" action to the workspace.
  2. Set the parameters correctly: in the "Collection" parameter set the collection without string or numeric elements, set the "Separator" as a character/characters.
  3. Run the robot. 

Implementation

  1. Repeat steps 1-3 of Task 1. 
  2. In the "Collection" parameters don't set the collection type. Leave it empty. 

 

Image Added

Result

The action returned an empty string.