I'm cleaning up some code files (C#) and want to remove the regions. And I would like to delete all the lines that have the string '#region'. That's just an example, and I can think of several more uses, but is that even possible?
Delete lines or connectors Click the line, connector, or shape that you want to delete, and then press Delete. Tip: If you want to delete multiple lines or connectors, select the first line, press and hold Ctrl while you select the other lines, and then press Delete.
Replacing text within Notepad Microsoft Notepad is included with all versions of Windows and can replace text in plain text files. To replace text in Notepad, follow the steps below. Open the text file in Notepad. Click Edit on the menu bar, then select Replace in the Edit menu.
Notepad++ v6.5
Search menu -> Find... -> Mark tab -> Find what: your search text, check Bookmark Line, then Mark All. This will bookmark all the lines with the search term, you'll see the blue circles in the margin.
Then Search menu -> Bookmark -> Remove Bookmarked Lines. This will delete all the bookmarked lines.
You can also use a regex to search. This method won't result in a blank line like John's and will actually delete the line.
Older Versions
You can use menu Search -> Replace... (Ctrl + H).
It has a regular expression feature for replacing. You can use a regex that matches #region as well as whatever else is on the line, and replace it with empty space.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With