Concatenate, concatenation, or concat is a term that describes combining a string, text, or other data in a series without any gaps. In programming languages, a function like strcat (string concatenation in C) or an operator is used to denote concatenation. For example, In the Java programming language, the operator “+” denotes concatenation, as it does in other programming languages.
C strcat() function
In the following example, the C function strcat would concatenate two strings contained in str1 and str2 together.
- C strcat() function
- Java concatenate
- Perl concatenate
- Excel and spreadsheet concatenate
- Related concatenate pages.
strcat(str1, str2);
Java concatenate
In the below Java example using the “+” operator on the string “Hello,” and the string " how are you?" would produce the single string “Hello, how are you?” when the program runs.
System.out.println(“Hello,” + " how are you?");
Perl concatenate
Other programming languages such as Perl can use a period for concatenation. For example, printing the same “Hello, how are you?” text in Perl would look similar to the example below.
print “Hello, " . “how are you?”;
A variable could also be concatenated into the text as shown in the example below. In this example, the output would be “Hello Nathan, how are you?” when running the script.
my $name = “Nathan”; print “Hello " . $name . “, how are you?”;
Excel and spreadsheet concatenate
Concatenate is also an Excel formula function. For example, in the below formula the concatenate function will combine the data in cell A2 with the date in cell B2 with a space delimiter.
=CONCATENATE(A2,” “,B2)
- How to combine cell values in Excel.
- How to merge cells in Excel and Calc.
Append, Combine, Programming terms, Spreadsheet terms
Related concatenate pages
- MS-DOS users wanting to combine the contents of one or more files can use the copy command.
- Linux and Unix users can combine one or more files using the cat command.
- How to create a computer program.