Fonctions génériques
| Nom | Description |
CONCAT
|
Concatène deux valeurs ou plus du même type. |
LENGTH
|
Calcule la longueur d'un String, Bytes, Array, Vector ou Map.
|
REVERSE
|
Inverse un String, Bytes ou Array.
|
Exemples de clients
Node.js
concat(constant("Author ID: "), field("authorId"));
Web
concat(constant("Author ID: "), field("authorId"));
Swift
let displayString = Constant("Author ID: ").concat([Field("authorId")])
Kotlin
val displayString = constant("Author ID: ").concat(field("authorId"))
Java
Expression displayString = constant("Author ID: ").concat(field("authorId"));
Python
Constant.of("Author ID: ").concat(Field.of("authorId"))
CONCAT
Syntaxe :
concat[T <: STRING | BYTES | ARRAY](values:T ...) -> T
Description :
Concatène deux valeurs ou plus du même type.
Exemples :
| valeurs | concat(values) |
|---|---|
| "abc", "def" | "abcdef" |
| [1, 2], [3, 4] | [1, 2, 3, 4] |
| b"abc", b"def" | b"abcdef" |
| "abc", [1,2,3], "ghi" | erreur |
| [1,2,3] | erreur |
| "abc", null | null |
LENGTH
Syntaxe :
length[T <: STRING | BYTES | ARRAY | VECTOR | MAP](value: T) -> INT64
Description :
Calcule la longueur d'une valeur String, Bytes, Array, Vector ou Map.
Exemples :
| valeur | length(value) |
|---|---|
| "bonjour" | 5 |
| [1, 2, 3, 4] | 4 |
| b"abcde" | 5 |
| null | null |
| 1 | erreur |
REVERSE
Syntaxe :
reverse[T <: STRING | BYTES | ARRAY](value: T) -> T
Description :
Inverse une valeur String, Bytes ou Array.
Exemples :
| valeur | reverse(value) |
|---|---|
| "bonjour" | "olleh" |
| [1, 2, 3] | [3, 2, 1] |
| b"abc" | b"cba" |
| 23 | erreur |
| null | null |