Function startsWith()
judges whether a string starts 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 ["Ul", "UL"] as b
return table(a, b, startsWith(a, b))
| a | b | startsWith(a, b) |
|------------|----|------------------|
| Ultipa | Ul | 1 |
| ULTIPA.com | UL | 1 |
Exalmple: Multiply and calculate
uncollect ["Ultipa", "ULTIPA.com"] as a
uncollect ["Ul", "UL"] as b
with startsWith(a, b) as c
return table(a, b, c)
| a | b | c |
|------------|----|---|
| Ultipa | Ul | 1 |
| Ultipa | UL | 0 |
| ULTIPA.com | Ul | 0 |
| ULTIPA.com | UL | 1 |