In Eclipse 3.3.2, I would like to replace a character (say ',') by a new line in a file. What should I write in the "Replace with" box in order to do so ?
EDIT : Many answers seems to be for Eclipse 3.4. Is there a solution for Eclipse 3.3.X ?
On the keyboard, press Ctrl + H to open the Find and Replace dialog box, with the Replace tab active. On the Replace tab, click in the Find What box. On the keyboard, press Ctrl + J to enter the line break character.
In Windows, a new line is denoted using “\r\n”, sometimes called a Carriage Return and Line Feed, or CRLF. Adding a new line in Java is as simple as including “\n” , “\r”, or “\r\n” at the end of our string.
Also in Window->Preferences->General->Editors->Text there is an option "show print margin". If you turn it on you'll always see vertical gray line that shows you when to break to a new line.
Check box 'Regular Expressions' and use '\R' in the 'Replace with' box
It's a new feature introduced with Eclipse 3.4, See What's New in 3.4
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