• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with LineNumberReader

 
vamsi bezawada
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have a string with line feeds. I try to read it as follows
LineNumberReader lnr = new LineNumberReader(new StringReader(String text));
String line = lnr.readLine();
the problem is readLine() returns the complete string which i pass to StringReader. It does not interprete the line feeds or carriage returns.
Strange thing is i see the different results on IE and netscape.
In netscape it seems to me that it recognises the line feeds and returns the line which i want. But not in IE.
I still need to test it, but anyway if somebody has any idea how to overcome it please tell me.
Thank you,
yours,
vamsi.
 
Neil Laurance
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the API, readLine should read until a '\n' '\r' or '\r\n' are seen. What characters are at the ends of your lines? :roll:
 
vamsi bezawada
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi neil,
Thanks for the reply. The text comes from external source. So i have no idea about the line termination character.
One strange thing as i said before is it is working with netscape and not with IE. In netscape i could breaklines using readLIne, but in IE it displays complete string.
I hope somebody have a solution for this.
Thank you,
bye,
vamsi.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!