You are viewing the documentation for Blueriq 16. Documentation for other versions is available in our documentation directory.
SPLIT
Returns a multivalued string attribute containing every substring that is delimited by the given pattern.
Syntax
SPLIT string ON pattern SPLIT ( string , pattern )
Inputs
- string - An attribute of base type string, an expression that results in a string or a constant string value.
- pattern - An attribute of base type string or a string value. String must be a valid regular expression. The regular expressions used in several Blueriq Encore functions are common Java 1.4 expressions. For a complete documentation we refer to the online java documentation.
Return type
- string (multivalued)
Example
Expression | Result | Type |
---|---|---|
SPLIT "Hello world" ON "o" | [ "Hell" , " w" , "rld" ] | String (multivalued) |
SPLIT ( "Hello world" , "a" ) | [ "Hello world" ] | String (multivalued) |
SPLIT "Hello" ON "o" | [ "Hell" ] | String (multivalued) |
SPLIT ( "ooo" , "o" ) | [ ] | String (multivalued) |
SPLIT ( "bot" , "o" ) | [ "b" , "t" ] | String (multivalued) |
SPLIT ( "boot" , "o" ) | [ "b" , "", "t" ] | String (multivalued) |
SPLIT ( "booot" , "o" ) | [ "b" , "", "t" ] | String (multivalued) |
To remove dots from a string in combination with the JOIN function: | ||
JOIN ( SPLIT ( "H.E.L.L.O" , "\.") , "" ) | "HELLO" | String |
If you use the SPLIT
in a default expression on an multivalued attribute, please note that the result will be stored as collection, meaning that all duplicates will be removed. To illustrate this: suppose we have an attribute Test.Splitted
(multivalued), which has the default expression SPLIT ( "H.E.L.L.O" , "\.")
. The result of the expression JOIN ( Test.Splitted , "" ) = "HELO" instead of "HELLO" as in the last example.
Overview
Content Tools