Hongmu Notes

🚱 Remove all spaces from text

Half-width spaces are deleted line by line, and line breaks and line order remain unchanged.

Instructions for use

  • Pasting text will delete half-width spaces line by line in real time and keep line breaks.
  • Tab characters and full-width spaces are not removed
  • To remove even line breaks, please use "Compress text into one line"

Code space removal

When copying code from a web page or document, there are often extra spaces, so it is cleaner to delete them.

Processing scope

Remove half-width spaces within the line, including spaces used for indentation at the beginning of the line.

Line breaks, tabs, and punctuation are preserved intact.

Things to note

Spaces in strings and regular expressions will also be removed, which may change the semantics.

It is only suitable for scenarios where all spaces are redundant, please confirm first.

Applicable scenarios

Clean up sample code copied from documentation and chat tools.

Remove excess indentation from the beginning of the line to facilitate alignment and viewing.

Result check

Check whether the string literal has been modified.

Confirm that the indentation structure is as expected.

alternatives

If you just want to remove spaces at the beginning and end of a line, use a special tool to remove spaces at the beginning and end of the line.

Use a text compression tool when you need to compress it into one line.

All keywords and tutorials 12

❓ FAQ

Will the indentation be removed?
Yes. Half-width spaces used for indentation at the beginning of lines are also removed.
Will tab indentation be deleted?
No. Tab characters are preserved, only half-width spaces are removed.