In what context are you asking this/what do you want to use it for? If
you for example want to use it for a DB query, you should solve your
problem using parameterized queries instead. If you want to prevent
malicious input in a web app, you should consider
System.Web.HttpUtility.HtmlEncode().