Notepad++: How to remove extra spaces at the start and end of each line

If you want to remove the spaces or tabs at the start and end of lines on Notepad++ you can either write your own regular expression with Replace option.

File in Notepad++ with leading and trailing spaces

But the best way to achieve this is by making use of the build option that you can find under Edit > Black Operation > Trim Leading and Trailing Space

Notepad++ Trim Leading and Trailing space
Result of Removing Spaces Notepad++

Tip: If you only want to trim certain line(s) then you can select it first and then use the trim option.

Comments & Discussion

Facing issues? Have questions? Post them here! We're happy to help!