История страницы
...
Check start Version 5 (Java)
Группа действий: Работа с текстом.
Описание
Определяет, совпадает ли начало текста с указанным образцом.
Иконка
Параметры
Входные параметры
Текст Исходный текст для обработки.
Предполагаемое начало Текст, с которым будет сравниваться начало исходного текста.
Выходные параметры
Результат Логическая переменная, в которую будет записан результат проверки.
Настройки
...
Свойство
...
Англ. наименование
...
Описание
...
Тип
...
Строка
...
Текст, с которым будет сравниваться начало исходного текста.
...
Логическая переменная, в которую будет записан результат проверки.
...
Особые условия использования
Отсутствуют.
Пример использования
Задача
Существует текстовая переменная "Вводный текст" с значением = Клик ЛКМ, текстовая переменная "Текст для сравнения" с значением = "Клик". Необходимо проверить совпадает ли начало текста с указанным образцом. При совпадении условия вывести сообщение - "начало текста совпадает с указанным образцом", при не совпадении "начало текста НЕ совпадает с указанным образцом".
Решение
Воспользоваться действиями "Проверить начало", "Если", "Сообщение".
Реализация
...
Action group: Text
...
Description
Determines if the beginning of the text matches the specified pattern
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Text | Source text for processing. | Robin.String | Yes | |
String to compare | The text to which the start of the source text will be compared. | Robin.String | Yes | |
Results | ||||
Result | A boolean variable to which the test result will be written. | Robin.Boolean | true |
Special conditions of use
None.
Example of use
Task
There is a text variable "Input text" with value = Click LMB, text variable "Text for comparison" with value = "Click". It is necessary to check whether the beginning of the text coincides with the specified sample. If the condition matches, output the message - "the beginning of the text matches the specified sample", if it does not match "the beginning of the text does NOT match the specified sample".
Solution
Use the actions "Check start", "If", "Show message".
Implementation
- Create a boolean variable to which the result of the "Check start" action will be written.
- Move the "Check start" action to the workspace and set its parameters.
- Move the "If" action to the workspace and set its parameter.
- Add a "Show message" action to the "Truth" branch and set its parameter.
- In the "False" branch, add a "Show message" action and set its parameter.
- Launch the robot using the "Start" button in the top panel.
Result
The result is displayed in the dialog box
Результат
Результат отображен в диалоговом окне