TOPICS
Search

Concatenation


The concatenation of two strings a and b is the string ab formed by joining a and b. Thus the concatenation of the strings "book" and "case" is the string "bookcase". The concatenation of two strings a and b is often denoted ab, a∥b, or, in the Wolfram Language, a<>b. Concatenation is an associative operation, so that the concatenation of three or more strings, for example abc, abcd, etc., is well-defined.

The concatenation of two or more numbers is the number formed by concatenating their numerals. For example, the concatenation of 1, 234, and 5678 is 12345678. The value of the result depends on the numeric base, which is typically understood from context.

The formula for the concatenation of numbers p and q in base b is

 p∥q=pb^(l(q))+q,

where

 l(q)=|_log_bq_|+1

is the number length of q in base b and |_x_| is the floor function.


See also

Consecutive Number Sequences, Number Length, Smarandache Sequences

Explore with Wolfram|Alpha

Cite this as:

Weisstein, Eric W. "Concatenation." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/Concatenation.html

Subject classifications