Function endsWith()
judges whether a string ends with a specified substring, and returns 1 for true, 0 for false.
Arguments:
- String <string>
- Substring <string>
Returns:
- Result <number>
Comman Usage
Exalmple: Direct calculate
uncollect ["Ultipa", "ULTIPA.com"] as a
uncollect ["a", "m"] as b
return table(a, b, endsWith(a, b))
| a | b | endsWith(a, b) |
|------------|---|------------------|
| Ultipa | a | 1 |
| ULTIPA.com | m | 1 |
Exalmple: Multiply and calculate
uncollect ["Ultipa", "ULTIPA.com"] as a
uncollect ["a", "m"] as b
with endsWith(a, b) as c
return table(a, b, c)
| a | b | c |
|------------|---|---|
| Ultipa | a | 1 |
| Ultipa | m | 0 |
| ULTIPA.com | a | 0 |
| ULTIPA.com | m | 1 |