История страницы
...
Check text for null and void Version 6 (Java)
Группа действий: Работа с текстом
Описание
Проверяет является ли текст пустым или равен "null"
Иконка
Параметры
Входные параметры
Текст Исходный текст для обработки.
Выходные параметры
Результат Логическая переменная, в которую будет записан результат проверки.
Настройки
...
Свойство
...
Англ. наименование
...
Описание
...
Тип
...
Исходный текст для обработки.
...
Логическая переменная, в которую будет записан результат проверки.
...
Особые условия использования
Отсутствуют.
Пример использования
Задача
Существует переменная "Вводный текст" с текстом "Привет". Требуется проверить текст в переменной на null и пустоту, результат записать в логическую переменную и вывести сообщение: текст пуст или текст имеется.
Решение
Воспользоваться действиями "Проверить на null и пустоту", "Если", "Сообщение".
Реализация
...
Action group: Text
...
Description
Checks if the text is empty or equal to "null"
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Text | Source text for processing. | Robin.String | Yes | |
Spaces as emptiness | Robin.Boolean | true | No | |
Results | ||||
Result | 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 variable "Input text" with the text "Hallo!". It is required to check the text in the variable for null and empty, write the result to a boolean variable and print a message: text is empty or text is present.
Solution
Use the actions "Check for null and void", "If", "Show message".
Implementation
- Create a boolean variable to which the result of the "Check for null and void" action will be written.
- Move the "Check for null and void" 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 text is found and the result is displayed in the dialog box
Результат
Текст найден, результат отображен в диалоговом окне