Columnal Documentation: Table of Contents

text functions

text lengthreplacereplace manyjoin textjoin text withtrimsplit textlower case
text length(text)length Type: (Text) -> Number

Gets the length of the given text.

Technical note: this is actually the number of Unicode codepoints in the text. For English text without accents, one character is one codepoint. If you have complex characters (e.g. flags) in your text, what looks like one character may be made up of multiple codepoints.

ExamplesClick an example to insert it
text length("hello")5
text length("a b.")4
text length("")0
replace(to replace, replacement, source)with replaced Type: (Text, Text, Text) -> Text

Replaces all occurrences of the first text with the second text, within the third text

If the first text is empty, no replacement is performed. If any occurrences overlap, the earlier part is replaced first.

ExamplesClick an example to insert it
replace("at", "og", "The cat in the hat")"The cog in the hog"
replace("oo", "a", "Mooo!")"Mao!"
replace("", "x", "Orange")"Orange"
replace many(replacements, source)with replaced Type: ([(find: Text, replace: Text)], Text) -> Text

Given a list of find/replace items, does all the find and replacements in the second parameter.

If the find text is empty, no replacement is performed. If any find occurrences overlap, the earliest matching item in the find/replace is used.

ExamplesClick an example to insert it
replace many([(find: "at", replace: "og"), (find: "the", replace: "a")], "the cat in the hat")"a cog in a hog"
replace many([(find: "ooo", replace: "eow"), (find: "oo", replace: "eh")], "Mooo moo mooo!")"Meow meh meow!"
replace many([(find: "apple", replace: "pear")], "orange")"orange"
replace many([], "original")"original"
join text(list of text)joined Type: ([Text]) -> Text

Joins a list of text values together as one text item.

If you want to add a separator between each text item, use join text with(..) instead.

ExamplesClick an example to insert it
join text(["a", "b", "c"])"abc"
join text(["Hello", " ", "Moon"])"Hello Moon"
join text([])""
join text with(list of text, separator)joined Type: ([Text], Text) -> Text

Joins a list of text values together as one text item, inserting a separator between each.

ExamplesClick an example to insert it
join text with(["a", "b", "c"], "+")"a+b+c"
join text with(["Blanks", "", "Count"], ";")"Blanks;;Count"
join text with(["Hello", " ", "Moon"], "-")"Hello- -Moon"
join text with(["Hi"], ",")"Hi"
join text with([], ",")""
trim(original)trimmed Type: (Text) -> Text

Removes white space from beginning and end of the text.

ExamplesClick an example to insert it
trim("No spaces either side.")"No spaces either side."
trim(" Several spaces ")"Several spaces"
trim("^t Tabs and newlines also removed.^n")"Tabs and newlines also removed."
split text(original, separator)split Type: (Text, Text) -> [Text]

Splits a text item into a list of smaller text items by dividing at the places where the separator occurs.

The returned list does not feature the separators.

ExamplesClick an example to insert it
split text("The quick brown fox", " ")["The", "quick", "brown", "fox"]
split text("6:08:32", ":")["6", "08", "32"]
split text("*abc*", "*")["", "abc", ""]
split text("Hello", "")["H", "e", "l", "l", "o"]
lower case(text)lower case text Type: (Text) -> Text

Changes all characters in the text value into lower-case versions, where possible.

ExamplesClick an example to insert it
lower case("HELLO")"hello"
lower case("Paris")"paris"
lower case("12345")"12345"