Notepad++ - "Replace with" adds new-line character after replaced text. How do I remove it?

Original text:

2###
Test 123

I am doing this operation:

Find what: 2###
Replace with: 2###\r\nText before 

Result:

2###
Text before
Test 123

Desired result:

2###
Text before Test 123

For some reason it adds a new-line after the replaced text. It seem to only happen when I add \r\n or \n in the Replace with.

How can I set it up so it does not insert this newline?


Solution 1:

Line 1 is actually 2###<new line>.

You are replacing 2### with 2###<newline>Text before, making the line (in effect) into 2###<newline>Text before<newline>.

You need to include the new line you want to replace in your search.

Find: 2###\r\n
Replace with: 2###\r\nText before