To prepend a string to every line of a selection, I usually use the "increase line indent" (which add tab to every line) and then run a search for tab / replace with my string.
Anyone know how I append a string to every line of a selection?
|
To prepend a string to every line of a selection, I usually use the "increase line indent" (which add tab to every line) and then run a search for tab / replace with my string. Anyone know how I append a string to every line of a selection?
| |||
|
feedback
|
|
Note: I misread the question initially, so I've posted this as a comment instead as it's still potentially useful but not an answer One method that doesn't involve find/replace (but only works if you want to do it on every line, including blank lines in your block), is this:
This allows you to type on every line simultaneously | |||||
feedback
|
|
Replace the regular expression | |||
feedback
|
This site is nice for testing regular expressions and has a quick reference: | |||||||
feedback
|
|
Alternatively,
Note that if you leave off the \n in the Replace with, all your lines will be pasted together (which is probably not what you want). I usually leave Notepad++ in Extended mode because it allows me to optionally paste lines to gether (by removing \n) or split them (by inserting \n), and doesn't get confused by special characters like *+() etc. (Which I am often searching for in C++ code.) | |||
|
feedback
|
Alt + Shiftand use the cursor down key to extend the selection to the end of the block. This allows you to type on every line simultaneously – Simon Oct 27 '11 at 9:26