How can I use newline with the Find-And-Replace in Visual Studio?

35,787

According to Helixoft: Multiline Search and Replace in Visual Studio
you can enable Regular Expressions and then use \n to indicate a new line.

Share:
35,787

Related videos on Youtube

Vivian River
Author by

Vivian River

Updated on September 17, 2022

Comments

  • Vivian River
    Vivian River almost 2 years

    I've become rather fond of the "Find-And-Replace" function in Visual Studio. The function lets me replace phrases, words, symbols, or whatever you can type into the textbox on the screen.

    How can I make it replace a character with a newline?

  • Charles Roberto Canato
    Charles Roberto Canato almost 10 years
    Also, if you're Finding and must cross a line, be careful to include \r\n to indicate that, as these don't get caught in wildcards.
  • Marwin
    Marwin almost 10 years
    This doesn't work in vs 2013
  • Tamara Wijsman
    Tamara Wijsman over 9 years
    @Marwin: Please note that some documents contain \r too. It works for me in VS 2013...
  • Marwin
    Marwin over 9 years
    \r\n worked, it is because of the windows line endings I guess. Thank you for the advice.