Ends with
See also: Starts with, Contains
The Ends with compare type checks if the text (String) given as the Check value (value configuration on the left) ends exactly with the string (String) defined as the Compare value (value configuration on the right).
The screenshot above uses static text value resolvers (see Static values) with the texts 'Check value' and 'Compare value' to illustrate the interaction of the components.
►NOTE◄
The text comparison is case sensitive.
There is no automatic conversion of unsuitable values to text (String). When required, the Input object (type safe) value resolver or a suitable value resolver from the String processing category can be used to convert another data type into a string.
Special cases:
The check is considered failed if at least one of the value configurations (Check value, Compare value) does not return a String.
Since 'No value' ($null) is also not a string, a check like ($null) Ends with ($null) is considered failed.
If the Check value and the Compare value match completely, an Ends with comparison is considered passed.
An empty string ("") can be used as a Check value and as a Compare value. A check with "" as a Compare value will always pass if the Check value is a String.
Specific examples:
Check value |
Compare value |
Check result |
Comments |
"321.99" |
"321.99" |
|
Check value Ends with the Compare value |
"321.99" |
"99" |
|
Check value Ends with the Compare value |
"321.99" |
"98" |
|
Check value does not end with the Compare value |
"" |
"99" |
|
Check value does not end with the Compare value |
321.99 |
"99" |
|
Check value is not a String |
$null |
"99" |
|
Check value is not a String |
"321.99" |
99 |
|
Compare value is not a String |
"321.99" |
$null |
|
Compare value is not a String |
"321.99" |
"" |
|
Check value Ends with the Compare value |
$null |
$null |
|
Check value is not a StringCompare value is not a String |
"" |
"" |
|
Check value Ends with the Compare value |
Configuration
The value configurations for Check value (left) and Compare value (right) are not optional for the Ends with compare type.
Both value configurations must return strings (String) at runtime, otherwise the Entity property rule is considered failed.
Examples
Check TLD of an e-mail address
An association criterion (see Association criteria) should be considered to have been passed precisely when the e-mail address stored for a guest user refers to the top-level domain cn for China.
Configuration:
|
|
Check whether each line of text was terminated with a semicolon
The Validating rule of an event handling (see Event handling) is intended to ensure that event actions are executed only if a list of strings, each of which ends with a semicolon (;), is passed as input value.
Configuration:
The AND conjunction shown on the right is configured as the Validating rule:
|
|
►NOTE◄ It may be necessary to exclude the special case that the list in the input value is completely empty ([]) by an additional rule in the AND conjunction. Because then the Rule list resolver also returns 'No value' ($null) and the Validating rule is considered to be fulfilled because no row is disputed.