views:

436

answers:

3

Hi,

If i have the following text in my eclipse editor:

Text Line 1
Text Line 2

I would like to concatenate the text into:

Text Line 1Text Line 2

My first idea was to search for carriage return character '\n' and replace it with '' to concatenate it.

I tried using the search function of eclipse, but it does not recognize carriage return character.

Are there any other editor that can do this ?

Thanks =)

+1  A: 

Most find and replace tasks in editors (at least, TextPad) have the ability to replace via a regex. If you can find this option in eclipse, then just use that.

Noon Silk
A: 

Just use Edit -> Find/Replace, switch on the Regular Expressions checkbox, search for \n and replace it by space.

I tried it in Eclipse 3.4 and it worked well.

Johannes Weiß
+1  A: 

Eclipse does this if you:

  • turn on regular expression mode is search/replace
  • enter \R for the newline
soru