Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert html special Characters

Status
Not open for further replies.

stsuing

Programmer
Aug 22, 2001
596
US
How would you convert

<span> to &lt;/span&gt

I would like to convert all characters that an XSLT would choke on.

Thanks in advance
 
Thanks for the response. I may try that. I was really looking for a code c# or vb solution. I was hoping somebody knew of a class that would do that for me
 
In that case, I think if you create the file using the XmlTextWriter it should convert all special characters for you.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks ca8msm

This is what I was looking for.
Dim str As String = "<span>Hello world</span>"
Console.WriteLine(System.Web.HttpUtility.HtmlEncode(str).ToString)

Sometimes you know it's in .Net but just can't find it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top