函数 endsWith() 可以计算一个字符串是否以指定的词尾为结尾,并返回 1(是)、0(否)。
Arguments:
- 字符串 <string>
- 词尾 <string>
Returns:
- 判断结果 <number>
一般用法
示例:异源别名直接计算
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 |
示例:异源别名笛卡尔积后计算
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 |