Easy C# way to unescape HTML strings?

This is a discussion on Easy C# way to unescape HTML strings? within the C# Programming forums, part of the General Programming Boards category; Is there an easy way to replace entities like & #039; with ' within a string? I found one that ...

  1. #1
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571

    Easy C# way to unescape HTML strings?

    Is there an easy way to replace entities like & #039; with ' within a string? I found one that unescapes URLs (for example %20-> space) but not one that unescapes HTML codes like > and the like.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Have you looked into the ASP.Net classes for whether there's a utility that does what you want?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

  4. #4
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Yeah, I was looking for one, didn't see that. Thanks!

    Edit: It says HttpUtility isn't in the System.Web namespace, in fact my System.Web namespace is all but empty.

    Edit200,000: OK figured it out, needed to add a reference to my project. Works fine now, thanks!
    Last edited by Cat; 11-16-2006 at 12:28 AM.
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please Help - C code creates dynamic HTML
    By Christie2008 in forum C Programming
    Replies: 19
    Last Post: 04-02-2008, 08:36 PM
  2. Problems with strings as key in STL maps
    By all_names_taken in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:34 AM
  3. Getting the number of strings in a STRINGTABLE resource
    By eth0 in forum Windows Programming
    Replies: 1
    Last Post: 09-30-2005, 03:57 AM
  4. Reading strings input by the user...
    By Cmuppet in forum C Programming
    Replies: 13
    Last Post: 07-21-2004, 07:37 AM
  5. problem with an array of strings in C
    By ornamatica in forum C Programming
    Replies: 14
    Last Post: 05-01-2002, 07:08 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21