🌐 US-Proxy
id="topics">
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.

For nonnegative integers p and q written without leading zeros in an integer base b>=2, the formula for concatenation is

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

where l(q) is the number length of q in base b. For q>=1, l(q)=|_log_bq_|+1, where |_x_| is the floor function, while l(0)=1.


See also

Concatenation Sequence, Consecutive Number Sequences, Kleene Star, Number Length, Smarandache Sequences, String, Word Morphism

Explore with Wolfram|Alpha

Cite this as:

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

Subject classifications