Skip to reading
PCA Script Programming

contains()

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
contains(text, search, case_sensitive = true)

Check whether text contains a substring.

Returns: Boolean.

Code example
contains("Archive Door", "door", false)

This builtin is a text search. For array membership, compare entries in a loop.

starts_with()#

Code example
starts_with(text, prefix, case_sensitive = true)

Check the beginning of text.

Returns: Boolean.

Code example
starts_with("open archive", "open ")

ends_with()#

Code example
ends_with(text, suffix, case_sensitive = true)

Check the end of text.

Returns: Boolean.

Code example
ends_with("notes.txt", ".txt")

replace()#

Code example
replace(text, search, replacement)

Replace matching occurrences of text.

Returns: New text.

Code example
replace("red door", "red", "blue")

Matching is case-sensitive.

Page 58 of 357Permalink
Go to page