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 File in Notepad++ with leading and trailing spaces](https://code2care.org/2015/remove-extra-spaces-at-start-and-end-of-each-line-notepad-plus-plus/images/File in Notepad++ with leading and trailing spaces.jpg)
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 Notepad++ Trim Leading and Trailing space](https://code2care.org/2015/remove-extra-spaces-at-start-and-end-of-each-line-notepad-plus-plus/images/Notepad++ Trim Leading and Trailing space.jpg)
![Result of Removing Spaces Notepad++ Result of Removing Spaces Notepad++](https://code2care.org/2015/remove-extra-spaces-at-start-and-end-of-each-line-notepad-plus-plus/images/Result of Removing Spaces Notepad++.jpg)
Facing issues? Have Questions? Post them here! I am happy to answer!
Author Info:
Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.
Follow him on: X
You can also reach out to him via e-mail: rakesh@code2care.org
More Posts related to NotepadPlusPlus,
- How to hide toolbar on Notepad++
- Change the default Line Encoding Notepad++ (CR LF)
- Notepad++ is about to exit prompt message
- How to force quit or kill Notepad++ Process
- Add Blank Lines Between Each Lines in Notepad++
- Install Notepad++ silently using Windows Powershell
- Prettify JSON in Notepad++
- Notepad++ Convert text from lower to upper case
- Must have CSV Plugins for Notepad++
- How to lock Notepad++ tabs?
- Column Mode Editing in Notepad++
- How to change background color in Notepad++
- Notepad++ sort by name with example
- How to rename a tab in Notepad++
- [Solved] Notepad++ Menu Bar Missing
- Where are Notepad++ temp unsaved files stored?
- Notepad++: How to add Quotes to CSV File
- How to check about details of Notepad++ text editor
- How to close all tabs of Notepad++?
- How choose alternate Tab Bar icon in Notepad++
- How to copy file name and path to clipboard in Notepad++
- Change default language highlighting in Notepad++
- Add Line Number before each line in Notepad++ using Column Editor
- Go to Line Number option in Windows Notepad
- How to show End of Line Characters in File using Notepad++
More Posts:
- [macOS] NetBeans IDE cannot be installed. Java (JRE) found on your computer but JDK XX or newer is required. - MacOS
- SharePoint list excel import error - Title is a required filed and can't be empty - SharePoint
- How to pretty print HTML using Java Code - Html
- Fix: Notepad++ bottom status bar not visible - NotepadPlusPlus
- How to get SharePoint Online user details from person or group column using REST API - SharePoint
- 23: Python Programs to concatenate two Lists - Python-Programs
- How to Connect to Azure AD Account using PowerShell on Mac - Powershell
- The author stylesheet specified in tag script is too long - document contains 21759 bytes whereas the limit is 10000 bytes - Html