The CONCAT function combines an arbitrarily large number of strings in the order they were provided.
This function takes any number of strings as input. It outputs a single string consisting of all those strings joined together, in the order they were given.
CONCAT(string_1, string_2,..., string_n) -> combined_string
- string_n (required, type: string)
- The nth string provided as input, where n is any positive integer.
- At least one string is required as input in order for CONCAT to run, and at least two strings are required as input in order for the CONCAT function to return output that differs from the input. There is no upper bound to the number of strings that can be used as input and thus no upper bound to n.
- combined_string (type: string)
- The string created by joining all the strings entered as input.
CONCAT("Hello, ", "world!") => "Hello, world"
In the above example, we hardcoded all the strings we wanted to input into CONCAT, but this does not need to be the case. For subsequent examples, assume all formulas have access to the following variables, stored as strings:
first_name = "Jane",
last_name = "Doe",
preferred_greeting = "Howdy"
CONCAT("Hello, " first_name) -> "Hello, Jane"
This last example joins six things: the string stored under the variable preferred_greeting, the string " ", the string stored under the variable first_name, the string " ", the string stored under the variable last_name, and the string "!" Note that the string " " appears twice: the input strings do not need to be unique.
CONCAT(preferred_greeting, " ", first_name, " ", last_name ", !") -> "Howdy, Jane Doe!"
The CONCAT function comes from an abbreviation of "concatenate," which means "link things together in a chain or series." In computer programming, string concatenation is the operation of joining character strings end-to-end. The functionality of CONCAT or CONCATENATE functions is fairly standardized, and if you've used either in another programming language, making use of Airscript's CONCAT function should offer few surprises.