Add a string to every line of a selection

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:

  • Move your cursor to the start of the first line
  • Hold down Alt + Shift and use the cursor down key to extend the selection to the end of the block

This allows you to type on every line simultaneously


  1. Choose Search -> Find
  2. Select the Replace tab
  3. Choose Regular expression as Search Mode in the bottom left
  4. Enter as Find what: $
  5. Enter as Replace with: the string you want to have at the end of the lines
  6. Check In selection
  7. Click Find Next or Replace All

This site is nice for testing regular expressions and has a quick reference:

http://rubular.com/


Replace the regular expression $ with the string you want.

Tags:

Notepad++