Skip to main content

Normalize spaces

Turn runs of spaces, tabs and no-break spaces into one space and trim the ends, keeping or joining the lines, e.g. for text read from web pages or PDFs.

Command in the String toolkit · id ooa.string/normalize_spaces · 2 inputs (1 required), 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
TextStringYesText to tidy.
Keep line breaksBooleanNofalseKeep the lines (tidying each, and dropping empty ones); when off, everything becomes one line.

Outputs​

OutputTypeWhat it is
resultStringThe tidied text.