Solved

Convert HTML tags to text

Posted on 2008-06-23
3
254 Views
Last Modified: 2013-11-19
Hi ,
i have an Obout control insteal of RTF Control in Asp. When i need to save something in the database the control allows me o save with the HTML tags associated with it.
suppose i have <br> hi this is test </br>  . the whole text field gets saved .
Qn 1. how can i remove the <br> tag or anyother tag and just insert the text contents.
Qn.2 i have already saved some with the html tags and how can i remove it.

and ofcourse this is in asp.net
0
Comment
Question by:sonukoshy
  • 3
3 Comments
 
LVL 15

Expert Comment

by:dosth
ID: 21844922
<%
Function stripHTMLtags(HTMLstring)

Set RegularExpressionObject = New RegExp

With RegularExpressionObject
.Pattern = "<[^>]+>"
.IgnoreCase = True
.Global = True
End With

stripHTMLtags = RegularExpressionObject.Replace(HTMLstring, "")
Set RegularExpressionObject = nothing

End Function
%>
0
 
LVL 15

Accepted Solution

by:
dosth earned 500 total points
ID: 21844930
0
 
LVL 15

Expert Comment

by:dosth
ID: 23979227
thanks for the points
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question