Skip to content

String

Join

Join(parts~: string[], separator?: string) -> string

The parts as one text, with separator between them. Without a separator they are run together.

parts~ converts: each value in parts becomes a string before Join runs, so a number, a boolean or a null there needs no conversion op.

output label = Join(["Bus", "7"], " ")
label
"Bus 7"
output code = Join(["A", "B", "C"])
code
"ABC"

Upper

Upper(text: string) -> string

The text in upper case.

output shout = Upper("live")
shout
"LIVE"

Lower

Lower(text: string) -> string

The text in lower case.

output quiet = Lower("LIVE")
quiet
"live"

Trim

Trim(text: string) -> string

The text without the spaces at its start and end.

output name = Trim("  cam 1  ")
name
"cam 1"

Contains

Contains(text: string, part: string) -> boolean

True when part appears in text. An empty part always does.

output isCamera = Contains("CAM 1", "CAM")
isCamera
true

StartsWith

StartsWith(text: string, part: string) -> boolean

True when text begins with part. An empty part always matches.

output isCamera = StartsWith("CAM 1", "CAM")
isCamera
true

EndsWith

EndsWith(text: string, part: string) -> boolean

True when text ends with part. An empty part always matches.

output isFirst = EndsWith("CAM 1", "1")
isFirst
true