Search code examples
javaintellij-idea

In IntelliJ IDEA how do I replace text with a new line?


I wanted to replace all commas with commas and a newline using IntelliJ IDEA's replace function. What do I put in the search box? In vim I'd use &\r.


Solution

  • You need to check the Regex box and use "\n" for the new line character:

    enter image description here