News:

Pretty crazy that we're closer to 2030, than we are 2005. Where did the time go!

Main Menu

[Java] PrintWriter println question

Started by Ryan Marcus, October 04, 2005, 09:13:59 AM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Ryan Marcus

I have named a PrintWriter pOut...

If I do this:

pOut.println("Test");


Will it print Test, Test + chr(13), Test + chr(10), or Test + chr(13) + chr(10)?
Thanks, Ryan Marcus

Quote
<OG-Trust> I BET YOU GOT A CAR!
<OG-Trust> A JAPANESE CAR!
Quote
deadly: Big blue fatass to the rescue!
496620796F75722072656164696E6720746869732C20796F75722061206E6572642E00

Tuberload

To be technical it will print "Test\n" which equates to string: Test + New Line(Line Feed).

Java is a cross platform language so the New Line literal is dependent upon the platform it is being executed on.
I am prepared to be ridiculed for what I believe, are you?

Ryan Marcus

Ok, so just to make sure:

Mac: chr(13)
Linux: chr(10)
PC: chr(13) + chr(10)

Right?
Thanks, Ryan Marcus

Quote
<OG-Trust> I BET YOU GOT A CAR!
<OG-Trust> A JAPANESE CAR!
Quote
deadly: Big blue fatass to the rescue!
496620796F75722072656164696E6720746869732C20796F75722061206E6572642E00

Tuberload

Quote from: Ryan Marcus on October 04, 2005, 05:41:34 PM
Ok, so just to make sure:

Mac: chr(13)
Linux: chr(10)
PC: chr(13) + chr(10)

Right?

Why do you need to know this? If you are trying to detect the new lines you can just compare it to it's character literal '\n'.

I believe you are correct, though I do not know what they are for Mac or *nix.
I am prepared to be ridiculed for what I believe, are you?