Skip to reading
PCA Script Programming

split() and aliases

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page
Code example
split(text, delimiter = " ", allow_empty = true)

Break text into an array at a delimiter.

Returns: Array of text pieces.

Aliases: string_split()

Code example
split("key, note,watch", ",", false)

Empty entries and whitespace around entries are separate matters; trim the pieces when required.

join()#

Code example
join(values, delimiter = "")

Join array entries, converting each to text.

Returns: Text.

Code example
join(["key", "note"], ", ")

string_length()#

Code example
string_length(value)

Count text characters; this implementation also accepts array/dictionary sizes.

Returns: Integer.

Code example
string_length("archive")

Use len() when the intention is a general container count.

format()#

Code example
format(template, values?)

Replace {key} from a dictionary, {0} positions from an array, or {value} for a single value.

Returns: Text.

Code example
format("Score: {value}", 25)

There are no printf precision directives or embedded PCA expressions in the braces.

Page 59 of 357Permalink
Go to page