Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove or Convert ' to (')

Tags:

html

c#

.net

ascii

I am consuming an api and I noticed that it comes back with "'s" and not an apostrophe. Since I am not going to be displaying this text in html this will make my text look weird when I display to the user.

How can I remove or convert(preferred)? I don't know if this api I am working with will be sending any more of these special codes so I don't know if I can just simply do a replace.

like image 700
chobo2 Avatar asked Jun 17 '13 23:06

chobo2


People also ask

How do I get rid of convert?

Remove the Simply Convert Files browser extension. The “Extensions” screen will be displayed with a list of all the extensions installed on Chrome. Scroll through the list until you find the Simply Convert Files extension, and then click on “Remove” to remove it.

What is Convertfiles free?

What is Convert Files 4 Free? Convert Files 4 Free is an advertising-supported browser extension. It promises to convert files formats, yet it also operates by running intrusive ad campaigns and spying on users' browsing activity.

What is simply Convertfiles?

Simply Convert Files is a browser extension endorsed as a tool for easy file format conversion. It is supposedly capable of converting document, image, and audio formats. Instead, Simply Convert Files operates as adware.

How do I delete a file in conversion now?

(at the top right corner of Google Chrome), select "Settings". In the "On startup" section, disable "File Conversion Now", look for a browser hijacker URL (hxxp://www.hfileconversionnow.com) below the “Open a specific or set of pages” option. If present, click on the three vertical dots icon and select “Remove”.


1 Answers

As of .NET 4.0 you can use System.Web.HttpUtility.HtmlDecode (resides in the System.Web.dll assembly, in the namespace System.Web).

Or you could use the System.Net.WebUtility.HtmlDecode function, you don't even need an extra reference for this (because it resides in the System.dll assembly, in the namespace System.Net).

Usage:

string myStringToDecode = "Hello 'World'";

string decodedString = System.Web.HttpUtility.HtmlDecode(myStringToDecode);
// or
string decodedString = System.Net.WebUtility.HtmlDecode(myStringToDecode);
like image 197
Styxxy Avatar answered Oct 25 '22 21:10

Styxxy