Concatenation

Concatenation is "the action of linking things together in a series" (Oxford English Dictionary). In computer programming terms, it refers to a function that links two or more text strings together into a single string. Databases and spreadsheets also use concatenation functions to merge data from separate fields and cells.

Most programming languages include several concatenation methods to combine strings. When used with text strings, the + operator often works, but special concatenation functions can provide developers with more control. For example, both of the following JavaScript samples join two variables, adding a space in between:

fullName = firstName+" "+lastName;

fullName = firstName.concat(" ", lastName);

While the + operator is most common, some languages use other operators. For example, Perl uses . to concatenate strings, while Visual Basic uses &.

Two cells in a spreadsheet joined using a concatenate function
Two cells in a spreadsheet joined using a concatenate function

Concatenation functions can also combine strings in database fields and spreadsheet cells. For example, if a customer information table in an SQL database keeps the first and last names in separate fields, you can use the CONCAT() function to select both and format them as a single string. Spreadsheet applications like Microsoft Excel can use the CONCATENATE() function to select the values of two referenced cells and display them as one joined value. For example, CONCATENATE(B2," ",C2) joins the contents of cells B2 and C2, with a space in between.

Updated June 2, 2023 by Brian P.

quizTest Your Knowledge

Which of the following statements about the Enum data type is true?

A
It is the most efficient way to store integers.
0%
B
It cannot store strings.
0%
C
It may contain a list of specific values.
0%
D
It is meant specifically for binary data.
0%
Correct! Incorrect!     View the Enum definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Concatenation on this page is an original definition written by the TechTerms.com team. If you would like to reference this page or cite this definition, please use the green citation links above.

The goal of TechTerms.com is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.