
-----------------------------------
Martin
Sun Sep 26, 2004 12:08 pm

String \ characters.
-----------------------------------
Suppose that I have a function:

public void whatever (String x);

Now, if I had the function called as follows:

whatever ("Hello
World
Here
I come");

What would x look like in this case? I imagine that it would be "Hello\nWorld\nHere\nI come"

Now, my second question, is do these escape characters (\n) cound as characters? What value would x.length return?

And finally, is there any way that I could do something like System.out.println (x) so that it shows all of the escape characters?

Thanks in advance,
Martin

-----------------------------------
Martin
Sun Sep 26, 2004 12:12 pm


-----------------------------------
Alright, I figured it out, except for the display of the escape characters.

-----------------------------------
wtd
Sun Sep 26, 2004 5:51 pm


-----------------------------------
x.replaceAll("\n", "\\n")
