Double spaces and padding
- Text to clean
- Hello world
- What to remove
- Extra spaces
Result Cleaned text: Hello world
Characters removed: 6
Space characters found: 7
Length before: 17
Length after: 11
- Found 7 space characters in 17 characters.
- Turned each run of spaces or tabs into one space and trimmed both ends of every line.
- 17 − 11 = 6 characters removed.
Leading and trailing spaces are trimmed and the triple gap becomes a single space.