# String Concatenation

> Joining strings end to end to make one longer string.

**Field:** Software Development  
**Category:** Programming Concepts  
**Also known as:** Concatenation, Joining Strings, Concat

## Think of it like

It is like joining train cars. Each car hooks onto the end of the one before.

## Definition

String concatenation joins two or more strings into one longer string. Many languages use the + sign to do it. "Hello, " + "Emma" makes "Hello, Emma". The parts are joined exactly, so spaces must be added by hand. Some languages will not join text and a number until you convert the number.

## Example

A shop app joins "Order " and the order number to show "Order 1042" on the receipt.

## Example code

```python
name = "Emma"
print("Hello, " + name)
# Hello, Emma
```

The + sign joins two strings. The space is inside the first one.

## Why it matters

Almost every app builds text for people to read. Messages, names and file paths are often joined from parts.

## Common mistake

Forgetting the space between the parts. "Hello," + "Emma" gives "Hello,Emma".

## Three principles

- **End to end.** Parts are joined in order.
- **Exact join.** No spaces are added for you.
- **Text only.** Numbers may need converting first.

## Related terms

- [String](https://learn.benibix.com/term/development/string)
- [Operator](https://learn.benibix.com/term/development/operator)
- [Type Conversion](https://learn.benibix.com/term/development/type-conversion)
- [Variable](https://learn.benibix.com/term/development/variable)

## Taught in

- [Type Conversion and Strings](https://learn.benibix.com/learn/development-concepts/type-conversion-and-strings): Programming Basics, 7/18

![Six small cards in two rows. Type conversion turns the text 42 into the number 42. Concatenation joins Hello and Emma. A tuple holds three values in fixed slots. An enum lists RED, AMBER and GREEN. A built-in function len counts five letters in hello. A hard-coded line has a tax rate of 0.2 written straight into the sum.](https://learn.benibix.com/diagrams/dev7-working-with-values.svg)

---

Source: https://learn.benibix.com/term/development/string-concatenation
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
