473,414 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Get the plain text from html string

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.
Nov 13 '06 #1
3 2304
RSH
Gary,

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

Ron
"Gary" <Ga**@discussions.microsoft.comwrote in message
news:CA**********************************@microsof t.com...
>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.

Nov 13 '06 #2
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.

"RSH" wrote:
Gary,

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

Ron
"Gary" <Ga**@discussions.microsoft.comwrote in message
news:CA**********************************@microsof t.com...
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.


Nov 13 '06 #3
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

"Gary" wrote:
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.

"RSH" wrote:
Gary,

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

Ron
"Gary" <Ga**@discussions.microsoft.comwrote in message
news:CA**********************************@microsof t.com...
>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.
Nov 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Inkiniteo | last post by:
Hi guys. I have a script that sends the info by email, but i'd like to avoid the convertion to HTML by the email client or Gmail, because it ruins all the formatting i did (with tabs, mostly)....
3
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo...
10
by: J. Alan Rueckgauer | last post by:
Hello. I'm looking for a simple way to do the following: We have a database that serves-up content to a website. Some of those items are events, some are news articles. They're stored in the...
14
by: Akseli Mäki | last post by:
Hi, Hopefully this is not too much offtopic. I'm working on a FAQ. I want to make two versions of it, plain text and HTML. I'm looking for a tool that will make a plain text doc out of the...
4
by: Nedo | last post by:
hi is there a simple way to convert a html-string to a plain text-string? thanks Nedo
2
by: Mike Bridge | last post by:
Is there any way to get Internet explorer to treat a text/plain .net page as plain text using asp.net? It seems like IE doesn't trust text/plain as a mime type, and so it (ironically) displays it...
10
by: Eric Lindsay | last post by:
This may be too far off topic, however I was looking at this page http://www.hixie.ch/advocacy/xhtml about XHTML problems by Ian Hickson. It is served as text/plain, according to Firefox...
2
by: Tim_Mac | last post by:
hi, i have a tricky problem and my regex expertise has reached its limit. i have read other posts on this newsgroup that pull out the plain text from a html string, but that won't work for me...
0
by: Rey | last post by:
Howdy all. Am using visual web developer 2005 (vb), xp pro sp2. In testing of the system.net.mail to send email from an aspx page where I'm pulling the email contents from a textbox, find that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.