This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Murach's Java Programming and have Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Remove HTML tags from a text file?  RSS feed

 
Harold Barnes
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggestions on an easy way to remove html tags from a text file? The only thing I can think of it to list the tags in an array and then replace occurences of them in the text file with nothing.
 
Joe Ess
Bartender
Posts: 9421
12
Linux Mac OS X Windows
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
proper html only contains < and > for the tags, otherwise < and > are used. so you could just look for the '<' and stop appending until you see '>'.
 
Timmy Marks
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or that.
 
Humans and their filthy friendship brings nothing but trouble. My only solace is this tiny ad:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!