Skip to main content

nonEmptyFirst

Returns the first argument of supported type that exists and is non empty. A String is non empty if it contains any non-whitespace character. A list or map is non empty if their length > 0.

nonEmptyFirst(...args)
# Or
nonEmptyFirst(listOfValues)

Parameters#

  • args: A supported value argument
  • listOfValues: list containing values of supported types

Returns#

  • First non empty value

Example#

assertTrue(nonEmptyFirst({}, [], 32) == 32)