File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
Get a single line from a String Buffer
Joined: Mar 25, 2004
Aug 18, 2004 20:04:00
How do i get a single line from a
buffer that has already been created?
Joined: Jun 02, 2003
Aug 18, 2004 20:22:00
How do you know the Stringbuffer contains lines at all?
If your buffer looks like this:
text2 seems to be a line, but text1 and text3 could be a part of a line.
For a buffer containing no NewLine at all, would you say the whole buffer is a line on it's own?
So do we have three lines here?:
Joined: Oct 29, 2001
Aug 19, 2004 07:58:00
You can read a line from a StringBuffer using Readers:
String aLine = new BufferedReader(new StringReader(strbuffer.toString())).readLine();
How To Ask Questions On JavaRanch
Joined: Mar 13, 2004
Aug 19, 2004 23:41:00
That gets you the first line.
You may need to create the BufferedReader as shown and then call readLine() on it until you get the line you want.
SCJP 1.4, SCWCD in process
I agree. Here's the link:
subject: Get a single line from a String Buffer
An exception in java-XML --kindly clarify-urgent
Pls Help on read the log file BACKWARd?
why it is giving errors
OutOfMemoryError: Java heap space error when exporting more than 65MB file
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014