Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to insert a line break in the Visual Studio Search/Replace?

Is it possible to search for a specific keyword in Visual studio and replace it with a block of code without removing line breaks?

For example, I want to search for :

SearchKeyword

And replace it with :

Line1
Line2
Line3
Line4

Assuming, of course, that the code block above is quite long and isn't a code that I can automatically format using Visual Studio or another tool.

like image 765
Ouissal Benameur Avatar asked Nov 02 '25 00:11

Ouissal Benameur


1 Answers

Enable "Use regular expressions" mode (the icon with the small square and the star), and enter \r\n as the code for line breaks. If you want to format your code, you might also need \t.

like image 78
Timbo Avatar answered Nov 03 '25 13:11

Timbo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!