String

Perform string manipulation and substitution operations.

isNullEmptyOrWhitespace

Determines if a string is null, empty, or only whitespace.

Input parameters for isNullEmptyOrWhitespace

  1. inString: String Optional. String to be checked.
  2. ifPresent: Boolean Optional.
    • If the value is set to true, the service checks whether inString is present or not, and only then proceeds with validation of the input.
    • If the value is set to false, the service throws an exception when inString is absent. Else, the service proceeds to validate the input.

Output parameters for isNullEmptyOrWhitespace

  • isNullEmptyOrWhitespace: String Indicates whether inString is null, empty, or only whitespace.
    • true indicates that inString has a null value, is empty, or is only whitespace.
    • false indicates that inString is not null, not empty, or is not only whitespace.
    Examples:
    • Service with inString = " \t\n\r\n" and ifPresent = true, returns true.
    • Service with inString=" \t\n\r\n" and ifPresent = false, returns true.
    • Service with inString = "abcd" and ifPresent = true, returns false.
    • Service with inString = "abcd" and ifPresent = false, returns false.
    • Service with ifPresent = true, returns true.
    • Service with ifPresent = false, throws an exception.

Usage notes for isNullEmptyOrWhitespace

isNullEmptyOrWhitespace replaces isNullOrBlank which is deprecated.

lookupTable

Locates a key in a String Table and returns the string to which that key is mapped.

Input parameters for lookupTable

  • lookupTable: String [] [] A multi-row, multi-column string table in which to search.
  • keyColumnIndex: String Index of the key column. Default is 0.
  • valueColumnIndex: String Index of the value column. Default is 1.
  • key: String Key to locate. The key is case sensitive.
  • ignoreCase: String Optional. Flag indicating whether to perform a case-sensitive or case-insensitive search. Set to,
    • True to perform a case-insensitive search.
    • False to perform a case-sensitive search. This is the default.
  • useRegex: String Optional. Flag indicating whether the values in the table are to be interpreted as regular expressions.
    Note: The regular expressions in the table should not include slashes. For example, use hello and not /hello./. Set to:
    • True to interpret the key column values in the table as regular expressions.
    • False to interpret the key column values in the table as literal values (that is, not regular expressions). This is the default.

Output parameters for lookupTable

value: String First value in the value column whose key matches key. If no match is found, this parameter is null.