🤲 Remove leading and trailing spaces from lines in batches
Clear the leading and trailing whitespace line by line (equivalent to trim).
Instructions for use
- Pasting multiple lines of text will clear the blanks at both ends in real time without clicking a button.
- Clear both ends; if you need to retain the indentation at the beginning of the line, please use "Batch Remove Ending Spaces"
- The number and order of lines remain unchanged, only blank lines will become blank lines.
Full-width space removal
The full-width spaces typed out by the Chinese input method have different widths from half-width spaces and are the most difficult to detect.
Identifying features
The width of a full-width space is approximately equal to one Chinese character, and its appearance is different from that of a half-width space.
In most editors it does not display any markup and is easily ignored.
common sources
Spaces typed out under the Chinese input method and content copied from Chinese web pages.
Some office software automatically fills in the gaps when exporting Chinese text.
problems caused
When there are extra full-width spaces at both ends, the list will not be aligned and the search will not match.
It may be determined as an illegal character when importing into a database or table.
Processing method
After pasting the entire paragraph, clean it line by line, and remove all full-width spaces as blank spaces.
Full-width spaces within the line are retained if they belong to the content, and only the ends are cleared.
used together
When full-width and half-width spaces are mixed, use "Remove leading and trailing spaces" to clear them all at once.
Compare or import after clearing, the matching results will be more reliable.
All keywords and tutorials 12
❓ FAQ
- Will full-width spaces and half-width spaces be cleared together?
- Yes. Both are considered blank, and the beginning and end of the line will be removed.
- Will the full-width spaces within the line be deleted?
- No. Only the beginning and end of each line are processed.
- Checking order for full-width spaces
- Clean both ends first → If there are still gaps, check for full-width spaces → Unify them with replacement.