История страницы
...
Insert into position Version 5 (Java)
Группа действий: Работа с текстом
Описание
Вставляет с указанной позиции заданный текст.
Параметры
Входные параметры:
Текст- Исходный текст для обработки;
Номер позиции - Порядковый номер символа, с которого будет начинаться удаление. Порядковый номер отсчитывается с "0";
Текст вставки - Текст, который необходимо вставить с указанной позиции;
Выходные параметры:
На выходе получаем строковую переменную, содержащую обработанный текст.
Настройки
...
Свойство
...
Англ. наименование
...
Описание
...
Тип
...
Исходный текст для обработки.
...
Тестовый текст
...
Порядковый номер символа, с которого будет начинаться удаление.
Порядковый номер отсчитывается с "0".
...
2
...
Текст, который необходимо вставить с указанной позиции.
...
Особые условия использования
Отсутствуют.
Пример использования
Задача: существует текстовая переменная "Вводный текст" с значением "Привет". Требуется отобразить в диалоговом окне значение "Привет, друг!".
Решение: воспользоваться действиями "Вставить на позицию", "Сообщение".
Реализация:
...
Action group: Text
...
Description
Inserts the specified text from the specified position
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Text | Text to make action on | Robin.String | Yes | |
Position number | The zero-based starting character position of a substring | Robin.Numeric | Yes | |
Insert text | The text to be inserted from the specified position. | Robin.String | Yes | |
Results | ||||
Result | A string variable containing the processed text. | Robin.String |
Special conditions of use
None.
Example of use
Task
There is a text variable "Input text" with the value "Hi". You need to display the value "Hi, friend!" in a dialog box.
Solution
Use the actions "Insert into position", "Show message".
Implementation
- Create a variable "Text variable" (type - text) to save the result of the "Insert into position" action into it.
- Drag the "Insert into position" action to the workspace and set its parameters.
- Move the "Show message" action to the workspace and set its parameters.
- Launch the robot using the "Start" button in the top panel.
Result
The desired message is displayed in the dialog box
...