Get the plain text from html string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am wondering what is the fastest way to get plain text such as "abc def 12"
from an HTML string.

I can parse it, but not sure how to deal with those special characters, such
as & and >. Is there an API to get the right plain text?

TIA.
 
Gary,

Regular experssions will do the trick. Do a quick search on Google for
Regular Expressions removing HTML formatting for example code.

Ron
 
Thanks for your reply.

Removing HTML is the same as parsing the text body, IMHO. The non-trival
part is how to process those special characters.

For example, when you encount " ", you should know it is 32 actually. There
is a bunch of special characters. It is painful to replace it one by one.
 
You need to give more information on what you are trying to achieve. Give a
sample bit of HTML and a sample of what you want to get from it.

Ciaran O'Donnell
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top