split()
expressionsince 0.5experimentalrequires runtimeSplits a string into a list, only as the single argument of pick(). Entries are trimmed and empty entries dropped.
On this page · 8 sections+−
Syntax
pick(split(<text>, "<delimiter>"))registry syntax: split(text, "delimiter")
Parameters
- text
<string>orattr()required - The text to split.
- delimiternon-empty
<string>required - There is no escape for the delimiter itself: choose one that does not occur in the values.
Return value
A transient list for pick(). The list is never stored, so state stays one scalar value.
Example
shuffle.cssreactive
.shuffle { --message: state("Hello");}.shuffle:on(click) { --message: set(pick(split(attr(data-greetings), "|")));}state()Function · hover any red tokenMakes each matching element the owner of an independent state with an initial value.Reference →
Behavior
- Entries are trimmed; empty entries are dropped.
Supported contexts
- Only as the single argument of
pick()insidestate()orset().
Limitations
- Experimental since 0.5.0.
- No
slice()or other list functions.
Related
Experimental · syntax may change between minor versions