Pusta lub pusta zmienna tekstowa
Czasownik: textNullOrEmpty
Sprawdza, czy treść zmiennej tekstowej jest pusta lub ma wartość NULL.
Składnia
textNullOrEmpty --text(String) (Boolean)=value
Dane wejściowe
| Skrypt | Projektant | Wymagane | AcceptedTypes | Opis |
|---|---|---|---|---|
| -- tekst | Tekst | Wymagane | Tekst | Zmienna tekstowa w celu sprawdzenia, czy treść jest pusta, czy ma wartość NULL. |
Wyjścia
| Skrypt | Projektant | AcceptedTypes | Opis |
|---|---|---|---|
| Wartość | Wynik | Wartość boolowska | Wartość boolowska, która zwraca wartość "true", jeśli parametr Tekst ma wartość NULL lub jest pusty, lub wartość "false", jeśli w przeciwnym razie występuje. |
Przykład
Przykład 1: Sprawdza, czy treść zmiennej tekstowej "checkText" ma wartość NULL lub jest pusta, w tym przypadku zwraca wartość True.
defVar --name checkText --type String
defVar --name nullOrEmpty --type Boolean
// Checks whether the content of the text variable (checkText) is null or empty.
textNullOrEmpty --text "${checkText}" nullOrEmpty=value
logMessage --message "${nullOrEmpty}" --type "Info"
// This example produces the following result: true.
Przykład 2: Sprawdza, czy treść zmiennej tekstowej "checkText" ma wartość NULL lub jest pusta, w tym przypadku zwraca wartość False.
defVar --name checkText --type String --value "IBM Robotic Process Automation"
defVar --name nullOrEmpty --type Boolean
// Checks whether the content of the text variable (verifiedText) is null or empty.
textNullOrEmpty --text "${checkText}" nullOrEmpty=value
logMessage --message "${nullOrEmpty}" --type "Info"
// This example produces the following result: false.
Uwagi
W parametrze Tekst :