🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #862

just a quickie

#862
From: Greg
Date: Sat, 01 Apr 2000 00:00
24 lines
1305 bytes
I have to read in a paragraph of text from a text file like the one shown
below only the program has to stop reading on the blank line.

================================
blah blah blah
hello hello

start of new paragraph
================================

this is what I have tried:

BufferedReader in = new BufferedReader(
                                       new FileReader("file.txt"));
String temp;

while((temp = in.readLine()) != "\n")   /* I have also tried ...!= "" */
{
   ......

could someone please tell me what to compare the String to, or where I am
going wrong. any help appreciated.

Greg
Technical Details
Message-ID: <S%dF4.1190$1b4.5128@news-server.bigpond.net.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d6db,1e8f92126f62286c,start
X-Google-Attributes: gid10d6db,public
From: "Greg" <gsimon@bigpond.net.au>
Subject: just a quickie
Date: 2000/04/01
Message-ID: <S%dF4.1190$1b4.5128@news-server.bigpond.net.au>
X-Deja-AN: 605094305
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
X-Complaints-To: news@bigpond.net.au
X-Trace: news-server.bigpond.net.au 954559602 144.132.88.26 (Sat, 01 Apr 2000 13:26:42 EST)
Organization: BigPond Internet Services (http://www.bigpond.net.au)
X-MSMail-Priority: Normal
NNTP-Posting-Date: Sat, 01 Apr 2000 13:26:42 EST
Newsgroups: aus.computers.java