Home

concatenates

Concatenation is the operation of joining two or more sequences end to start to produce a longer sequence. The verb form concatenates describes performing this operation. In computing, concatenation is commonly applied to strings, arrays, lists, or byte sequences. The result preserves the order of operands; the length equals the sum of the operands' lengths. In mathematics, sequence concatenation is similarly defined and is associative.

Most programming languages provide a way to concatenate. In many languages, a plus operator combines strings;

When concatenating, encoding matters for textual data. Unicode handling requires consistent encoding and normalization; concatenating characters

Applications include constructing user messages, file or URL paths, CSV lines, and data serialization. In SQL,

The concept underpins many data-processing tasks, including building keys, composing strings from parts, and merging sequences

in
others,
dedicated
functions
or
methods
exist,
such
as
concat,
join,
or
append.
The
exact
semantics
vary:
strings
may
be
immutable
or
mutable,
and
source
code
may
optimize
with
temporary
buffers.
Repeatedly
concatenating
strings
in
languages
with
immutable
strings
can
lead
to
quadratic
time
complexity;
techniques
such
as
using
a
StringBuilder,
a
list
of
fragments,
or
a
join
operation
are
preferred.
from
different
scripts
generally
works,
but
normalization
forms
can
affect
results
in
some
contexts.
CONCAT
or
the
||
operator
concatenates
strings;
in
Python,
'a'
+
'b'
yields
'ab',
and
''.join(list)
is
efficient
for
many
elements;
in
JavaScript,
the
+
operator
or
Array.prototype.concat
accomplishes
the
task.
in
data
structures.
See
also:
string
manipulation,
string
builder,
join.