processing escape sequences exactly like compiler does

H

Harald Kirsch

In

http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html

under 3.10.6 the escape sequences allowed
in a Java String literal are described.
When using a String literal in Java source
code, the compiler does the conversion for
me.

Now suppose I get character data, e.g. from
a file, and I want to perform the exact same
escape processing as the compiler would do.
Is there a ready made method somewhere
available to do this?

Note: don't waste your time by telling me
how I could do this myself. I can do
that, but using something "official" would
be the preferred solution.

Thanks,
Harald.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,052
Members
48,769
Latest member
Clifft

Latest Threads

Top