Search code examples
visual-studioreplacecarriage-return

Find and replace - Add carriage return OR Newline


In the case of following string to be parsed.

ford mustang,10,blue~~?bugatti veyron,13,black

I want to replace the ~~? with a carriage return

Replacing with \n just adds the string "\n"

How can this be done?


Solution

  • Make sure Use: Regular expressions is selected in the Find and Replace dialog:

    Find/Replace Dialog Use Regular expressions

    Note that for Visual Studio 2010, this doesn't work in the Visual Studio Productivity Power Tools' Quick Find extension (as of the July 2011 update); instead, you'll need to use the full Find and Replace dialog (use Ctrl+Shift+H, or Edit --> Find and Replace --> Replace in Files), and change the scope to Current Document.