# Little help with Java



## Jacko28 (Nov 3, 2009)

I've began slowly learning java, however this morning I came to a halt, it's such a simple problem but I just can't get around it.

The line of code involves using escape seqeuences to put illiegal characters into a print.out statement. 

"(\+\=\ \\)" ! help ! "{/&\is/\\}".

Basically I have to put this into a line of code but I cant seem to get the escape sequences to work. From what I've read by using \ you can input the characters.

Would it be ;

\"(\\+\\=\\ \\\\)\" ! but ! \"{/&\is/\\\\}\". - To me this seems wrong and to my compiler it is wrong 

Any help would be appreciated, many thanks

Jacko28


----------



## FordGT90Concept (Nov 3, 2009)

Only quotes (because they start and end a string declaration) and backslashes (because they define the escape character) need to be escaped:
string s = "\"(\\+\\=\\ \\\\)\" ! help ! \"{/&\\is/\\\\}\"";

You forgot the extra backslash before "is"


----------



## Jacko28 (Nov 3, 2009)

Thanks alot FordGT!


----------

