Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » escaping string literals
escaping string literals [message #251301] Thu, 07 February 2008 19:49 Go to next message
Eclipse UserFriend
Originally posted by: wharley.bea.com

I've got the "escape when pasting into string literals" setting checked in
the Java Editor configuration. So, when I paste multiline text into a
string literal in a Java editor, the editor helpfully escapes the string,
putting \ before any nested ", breaking newlines into multiple literals with
+ between them, and so forth.

However, all the newlines are escaped as '\r\n' rather than just '\n'.

It doesn't seem to matter what source I'm pasting from: I've tried copying
from the debug console, from Notepad, etc. So I don't think it's anything
special about the contents of the clipboard.

This is happening on Eclipse 3.3 and 3.4, latest builds of each, on Windows
XP.

Is there any way to make it paste just '\n', rather than '\r\n'?

Thanks!
Re: escaping string literals [message #251310 is a reply to message #251301] Fri, 08 February 2008 05:36 Go to previous message
Eclipse UserFriend
Walter Harley wrote:

>I've got the "escape when pasting into string literals" setting checked in
>the Java Editor configuration. So, when I paste multiline text into a
>string literal in a Java editor, the editor helpfully escapes the string,
>putting \ before any nested ", breaking newlines into multiple literals with
>+ between them, and so forth.
>
>However, all the newlines are escaped as '\r\n' rather than just '\n'.
>
>It doesn't seem to matter what source I'm pasting from: I've tried copying
>from the debug console, from Notepad, etc. So I don't think it's anything
>special about the contents of the clipboard.
>
>This is happening on Eclipse 3.3 and 3.4, latest builds of each, on Windows
>XP.
>
>Is there any way to make it paste just '\n', rather than '\r\n'?
>
>
Nope. We use the line delimiter that's used in the document you're editing.

Dani

>Thanks!
>
>
>
>
Previous Topic:Breakpoint shows class from wrong library
Next Topic:ClasspathContainer not being observed for dependencies
Goto Forum:
  


Current Time: Wed May 07 14:50:14 EDT 2025

Powered by FUDForum. Page generated in 0.04933 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top