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

Ключ

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

...

Check ending Version 5 (Java)

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

Описание

Определяет, совпадает ли окончание текста с указанным образцом.

Иконка

Image Removed

Параметры

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

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

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

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

Результат Логическая переменная, в которую будет записан результат проверки.

Настройки

...

Свойство

...

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

...

Описание

...

Тип

...

Строка

...

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

...

Action group: Text

...

Description

Determines if the ending of the text matches the specified pattern

Action icon

Image Added

Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
Source textText to make action onRobin.String
Yes
Estimated endingThe text to which the end of the source text will be comparedRobin.String
Yes
Results
ResultBoolean variable to which the test result will be writtenRobin.Booleantrue

Special conditions of use

None.

Example of use

Task

There is a text variable "Input text" with value = LKM Click, text variable "Text for comparison" with value = "LMB". It is necessary to check whether the end of the text coincides with the specified sample.  If the condition matches, output the message - "the end of the text matches the specified pattern", if it does not match "the end of the text does NOT match the specified pattern". 

Solution

Use the "Check ending", "If", and "Show message" actions.

Implementation

  1. Create a boolean variable to which the result of the "Check start" action will be written. 
    Image Added

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

  3. Move the "If" action to the workspace and set its parameter. 
    Image Added

  4. Add a "Show message" action to the "Truth" branch and set its parameter. 
    Image Added

  5. In the "False" branch, add a "Show message" action and set its parameter. 
    Image Added

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

Result

The result is displayed in the dialog box. 
Image Added

...

Логическая переменная, в которую будет записан результат проверки.

...

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

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

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

Задача 

Существует текстовая переменная "Вводный текст" с значением = Клик ЛКМ, текстовая переменная "Текст для сравнения" с значением = "ЛКМ". Необходимо проверить совпадает ли конец текста с указанным образцом.  При совпадении условия вывести сообщение - "окончание текста совпадает с указанным образцом", при не совпадении "окончание текста НЕ совпадает с указанным образцом". 

Решение

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

Реализация 

...

Результат

Результат отображен в диалоговом окне 
Image Removed