# strip()

*noun*

say it: **“STRIP”** **/ˈstrɪp/**

A string method that gives back the string without spaces, tabs or newlines at its start and end.

## What does `strip()` do?

`strip()` removes spaces (and new lines) from both ends of a string. Great for cleaning up what users type.

```python
email = "  sam@example.com  "
print(email.strip())  # sam@example.com
```

## In a sentence

- “**strip()** cleaned the spaces from around the email address the user typed.”
- “Each line read from the file needed **strip()** to drop its newline.”

Level: Apprentice · [More Python terms at this level](https://www.ask-codey.com/glossary?category=python&level=2)

Updated: November 19, 2026

Source: https://www.ask-codey.com/glossary/strip
