I cannot find a way to replace a string with a newline in PHPStorm. Anybody has ideas? Tried \n but it will just add the 2 characters instead of inserting a newline character. Additional data following SolarBear answer Here is the use case:
Original text:
"aaaaa","bbbbb","CCC", some other text
Desired text
"aaaaa"=>"iiii", "bbbbb"=>"iiii", "CCC"=>"iiii",
some other text
When I try SolarBear solution, I select the "aaaa" line and select multiline, and have
,
in the top box and
=>"iiii", [newline]
in the second box. What happens is that the first "," is replaced, but curiously when I hit replace next "," PHPStorm replaces again the same "," Here is the output after hitting the replace button:
"aaaaa"=>"iiii"=>"iiii", "bbbbb","CCCC"
So: Press CTRL-h and the Replace dialog will open. Type \r\n in "Find what" and \\r\\n in "Replace with". Then select search mode Extended (\r, \n, \t, \x..., \0) and click "Replace All".
From the main menu, select Edit | Find | Find in Files Ctrl+Shift+F . In the search field, type your search string. Alternatively, in the editor, highlight the string you want to find and press Ctrl+Shift+F . PhpStorm places the highlighted string into the search field.
,
=>"iiii",\n
Regex
option (as shown on 1st screenshot below)BEFORE:
AFTER:
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