String functions
This page describes the additional set of predefined Jsonnet functions for the Data Transformer Script task available in Application Integration.
Before you begin
To use the following predefined functions, you must import the functions
library in your script. Importing the functions
library lets you use both the standard Jsonnet functions and the predefined Data Transformer functions.
Application Integration supports Jsonnet functions library v0.20.0. For information about the Jsonnet standard functions, see Jsonnet Standard Library.
Equals Ignore Case
Syntax |
equalsIgnoreCase(str1, str2) |
---|---|
Description | Compare the two given string values irrespective of the string case (lower or upper). |
Input parameter | str1: An input string.
str2: An input string. |
Return type | BOOLEAN
|
Output | Returns TRUE if the specified value matches the existing value (ignoring case) and FALSE otherwise. |
Is Empty
Syntax |
isEmpty(str) |
---|---|
Description | Checks if the length of the given string is 0. |
Input parameter | str: The input string. |
Return type | BOOLEAN
|
Output | Returns TRUE if the string is empty and FALSE otherwise. |
Match
Syntax |
match(str, regexp) |
---|---|
Description | Retrieves the result of matching a string against a regular expression. |
Input parameter | str: Input string.
regexp: The re2 regular expression. |
Return type | ARRAY
|
Output | Returns an array of all substrings of str that match the regular expression, regexp . Returns an empty array if there is no match.
|
Trim
Syntax |
trim(str) |
---|---|
Description | Removes all the leading and trailing spaces of a given string. |
Input parameter | str: The input string. |
Return type | STRING
|
Output | Returns a copy of the string, with leading and trailing whitespace removed. |
Recommendation
- Learn how to add and configure a Data Transformer Script task (Preview)