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

Ключ

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

...

Insert into position Version 5 (Java)

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

Описание

Вставляет с указанной позиции заданный текст. 

Image Removed

Параметры

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

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

  2. Номер позиции - Порядковый номер символа, с которого будет начинаться удаление. Порядковый номер отсчитывается с "0";

  3. Текст вставки - Текст, который необходимо вставить с указанной позиции;

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

На выходе получаем строковую переменную, содержащую обработанный текст.

Настройки

...

Свойство

...

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

...

Описание

...

Тип

...

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

...

Тестовый текст

...

Порядковый номер символа, с которого будет начинаться удаление.

Порядковый номер отсчитывается с "0".

...

2

...

Текст, который необходимо вставить с указанной позиции.

...

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

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

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

Задача: существует текстовая переменная "Вводный текст" с значением "Привет". Требуется отобразить в диалоговом окне значение "Привет, друг!". 

Image Removed

Решение: воспользоваться действиями "Вставить на позицию", "Сообщение". 

Реализация: 

...

Action group: Text

...

Description

Inserts the specified text from the specified position

Action icon

Image Added

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
TextText to make action onRobin.String
Yes
Position numberThe zero-based starting character position of a substringRobin.Numeric
Yes
Insert textThe text to be inserted from the specified position.Robin.String
Yes
Results
ResultA 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. 

Image Added

Solution

Use the actions "Insert into position", "Show message". 

Implementation

  1. Create a variable "Text variable" (type - text) to save the result of the "Insert into position" action into it. 
    Image Added
  2. Drag the "Insert into position" action to the workspace and set its parameters.

    Image Added
  3. Move the "Show message" action to the workspace and set its parameters.
    Image Added
  4. Launch the robot using the "Start" button in the top panel. 


Result

The desired message is displayed in the dialog box 
Image Added
Image Added

...