Empty or Null Text Variable

Verb: textNullOrEmpty

Checks whether the content of a text variable is empty or null.

Syntax

textNullOrEmpty --text(String) (Boolean)=value

Inputs

Script Designer Required AcceptedTypes Description
--text Text Required Text Text variable to check whether the content is empty or null.

Outputs

Script Designer AcceptedTypes Description
value Result Boolean Boolean that returns "true" if the Text parameter is null or empty, or "false" if otherwise.

Example

Example 1: Checks whether the content of the text variable "checkText" is null or empty, in this case returning 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.

Example 2: Checks whether the content of the text variable "checkText" is null or empty, in this case returning False.

defVar --name checkText --type String --value "IBM"
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.

Remarks

In the Text parameter:

  • It is considered as null any variable that has no value assigned to it, so there is no reference address for this variable in the computational memory.
  • It is considered as empty any text variable that has an empty string assigned to it, ie blank space. Thus, the length is 0 and the reference to this variable in computational memory exists.
  • See Also

  • Add Escape Characters to Regular Expression
  • Add Escape Characters to Text
  • Calculate Hash
  • Change Text Case
  • Check File
  • Concatenate Texts
  • Convert HTML to Text
  • Count Occurrences in Text
  • Count Text Characters
  • Create Random Text
  • Create Table By Regular Expression
  • Find by Regular Expression
  • Find Occurrences in Text
  • Format Text
  • Get Subtext
  • Get Text from Regular Expression
  • HTML to Markdown
  • Insert New Line to Text
  • Join Text
  • Pad Text
  • Parse URI
  • Remove Diacritics
  • Remove Escape Characters
  • Replace Part of Text
  • Replace Text
  • Split Text
  • Trim Text Blanks