• Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating a reader on a string of text  RSS feed

 
Chris Blanchard
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, my problem is that I'd like to use the HTMLEditor kit on a string, to get rid of all the HTML coding.

At the moment I'm doing something like


The problem is that this stores and prints out on the whole URL, and I only want it to do it on part of the URL. So my solution is to store the chunk that I want in a string, and the run the Editor kit on it again, which requires me to somehow create a buffered reader on a stirng.

Is this possible or is there a better way of doing this?
 
Dave Wingate
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My first thought would be to use the getBytes() method of the String class to get a byte[] representation of the String and then pass that to the constructor for a ByteArrayInputStream.
 
Dave Wingate
Ranch Hand
Posts: 262
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The StringReader class may also work for you and result in simpler code.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!