| | |
C# equivalent for the PHP strip_tags()
Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
•
•
Hi, I'm looking for the equivalent in C# of this function: strip_tags().
I want to use it to validate some input and avoid SQL injection. Any ideas?
Thanks in advance.
It emulates the strip_tags() function in PHP and does a very good job too (5 microseconds on my laptop on a 80kb HTML).
All about it (free code and documentation) you can find at my Code Project Article
Have a look on my implementation of the PHP's strip_tags function here -> http://www.codeproject.com/KB/MCMS/htmlTagStripper.aspx
•
•
Join Date: Jan 2008
Posts: 23
Reputation:
Solved Threads: 0
use regular expresion to strip tags, like
asp.net Syntax (Toggle Plain Text)
System.Text.RegularExpressions.Regex regHtml = new System.Text.RegularExpressions.Regex("<[^>]*>"); string s = regHtml.Replace(InputString,"");
Last edited by peter_budo; Nov 28th, 2008 at 1:07 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: richtextbox in asp.net
- Next Thread: Search an access database
Views: 2779 | Replies: 4
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 ajax alltypeofvideos anathor appliances application asp asp.net beginner box browser button c# cac checkbox class commonfunctions complex control countryselector dataaccesslayer database datagridview datalist deployment development dgv dialog dropdownlist dynamic dynamically edit editing embeddingactivexcontrol feedback fileuploader fill findcontrol flash form gridview gudi iis image javascript languages list listbox login maps microsoft mobile mouse mssql news novell numerical opera panelmasterpagebuttoncontrols parent problem profile project radio redirect registration relationaldatabases reportemail response.redirect richtextbox rows schoolproject search security select sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl tracking treeview validatedate validation vb.net videos vista visualstudio vs2008 web webapplications webdevelopment webprogramming webservice wizard xsl





