# String

> A piece of text in a program. It is written inside quote marks, like "Hello".

**Field:** Software Development  
**Category:** Programming Concepts  
**Also known as:** Text String, str

## Think of it like

Think of it like beads on a thread. Each bead is a letter, and the thread keeps them in order.

## Definition

A string is a piece of text in a program. It is a row of characters, like letters, digits, spaces and signs. You write it inside quote marks, like "Hello". Programs can join strings, cut them, count their letters or change them to capitals. A name, a message and an address are all usually stored as strings.

## Example

A sign-up form keeps the name "Emma Brown" as a string. The site counts 10 characters, space included.

## Example code

```python
>>> name = "Emma" + " " + "Brown"
>>> len(name)
10
>>> name.upper()
'EMMA BROWN'
```

Three strings joined into one, then counted and turned to capitals.

## Why it matters

Most of what people type and read is text. Almost every program spends a lot of time with strings.

## Common mistake

Forgetting the quote marks. Without them, the computer reads the word as the name of a variable.

## Three principles

- **Text in quotes.** Quote marks show where the text starts and ends.
- **A row of characters.** Each letter, digit or space has a place.
- **Many tools.** Join, cut, count and change case.

## Related terms

- [Data Type](https://learn.benibix.com/term/development/data-type)
- [Variable](https://learn.benibix.com/term/development/variable)
- [Integer](https://learn.benibix.com/term/development/integer)
- [Index](https://learn.benibix.com/term/development/index)
- [Escape Character](https://learn.benibix.com/term/development/escape-character)
- [String Concatenation](https://learn.benibix.com/term/development/string-concatenation)

## Taught in

- [Data Types in Python](https://learn.benibix.com/learn/development-concepts/data-types-in-python): Programming Basics, 6/18
- [Regular Expressions (Regex)](https://learn.benibix.com/learn/development-formats/regular-expressions-regex): File Formats, 11/11

---

Source: https://learn.benibix.com/term/development/string
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-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
