Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Convert HTML tags to text

Posted on 2008-06-23
3
Medium Priority
?
273 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 total points
ID: 21844930
0
 
LVL 15

Expert Comment

by:dosth
ID: 23979227
thanks for the points
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
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:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

721 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