Originally posted by Campbell Ritchie:
You know that \ is a sort of meta-character in Java strings; it "escapes" the character following.
Backslash is a special character in Java string
literals (and char literals, too). That is, when you want to type a fixed string into your source code, you have to use backslash escape codes for some special characters (including backslash).
Once the characters are stored in a Java String object on the heap, the special meaning of backslash is gone. A backslash in a Java String object is just a backslash, nothing more.
[ October 16, 2007: Message edited by: Peter Chase ]