Author Topic: [Java] PrintWriter println question  (Read 4825 times)

0 Members and 1 Guest are viewing this topic.

Offline Ryan Marcus

  • Cross Platform.
  • Full Member
  • ***
  • Posts: 170
  • I'm Bono.
    • View Profile
    • My Blog
[Java] PrintWriter println question
« on: October 04, 2005, 09:13:59 am »
I have named a PrintWriter pOut...

If I do this:
Code: [Select]
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

Offline Tuberload

  • Neophyte
  • x86
  • Hero Member
  • *****
  • Posts: 530
    • View Profile
Re: [Java] PrintWriter println question
« Reply #1 on: October 04, 2005, 02:00:14 pm »
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?

Offline Ryan Marcus

  • Cross Platform.
  • Full Member
  • ***
  • Posts: 170
  • I'm Bono.
    • View Profile
    • My Blog
Re: [Java] PrintWriter println question
« Reply #2 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?
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

Offline Tuberload

  • Neophyte
  • x86
  • Hero Member
  • *****
  • Posts: 530
    • View Profile
Re: [Java] PrintWriter println question
« Reply #3 on: October 04, 2005, 08:18:16 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?