Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text;
- using System.Web;
- namespace Encodorama
- {
- static class StringExtensions
- {
- public static string ToASCII(this string s)
- {
- return Encoding.ASCII.GetString (Encoding.Unicode.GetBytes (s));
- }
- }
- class MainClass
- {
- public static void Main (string[] args)
- {
- var s = HttpUtility.HtmlDecode ("† is a Unicode character representing a cross.");
- Console.WriteLine (s);
- Console.WriteLine (s.ToASCII ());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement