String concatenation is the operation of joining two character strings end-to-end.
In particular in the theory of computation, the concatenation operation on strings is generalized to an operation on sets of strings as follows:
For two sets of strings S1 and S2, the concatenation S1S2 consists of all strings of the form vw where v is a string from S1 and w is a string from S2. In this definition, the string vw is the ordinary concatenation of strings v and w as defined in the introductory section. In this context, sets of strings are often referred to as formal languages.
Programming languages often provide operators (such as the +
sign) to simplify concatenation of strings. For example, "s1" + "s2"
would result in "s1s2"
.