Solved

Convert HTML tags to text

Posted on 2008-06-23
3
264 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 500 total points
ID: 21844930
0
 
LVL 15

Expert Comment

by:dosth
ID: 23979227
thanks for the points
0

Featured Post

PowerShell Core for Advanced Linux Administrators

Understand advanced principals around Powershell Core with a focus on the Linux Administrator.  This course covers how to administer numerous environments across multiple platforms including Linux, Azure, AWS, and Google Cloud from a single shell instance.

Question has a verified solution.

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

Developer portfolios can be a bit of an enigma—how do you present yourself to employers without burying them in lines of code?  A modern portfolio is more than just work samples, it’s also a statement of how you work.
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

630 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