Skip to content

Instantly share code, notes, and snippets.

@garenyondem
Last active December 28, 2017 12:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garenyondem/f5b5e2319a50a126ea2db5d6670308db to your computer and use it in GitHub Desktop.
Save garenyondem/f5b5e2319a50a126ea2db5d6670308db to your computer and use it in GitHub Desktop.
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
this.Loaded += MainPage_Loaded;
}
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
var encodedText = "All the 🌎's a 🎦," +
" And all the 👨 and 👩 merely 🎮; " +
"They have their exits and their 🚪, And one 👨 " +
"in his ⌛ 🎮 many parts...";
MyTextBlock.Text = encodedText.DecodeHtmlEntity();
}
}
public static class Extensions
{
public static string EncodeHtmlEntity(this string value)
{
return WebUtility.HtmlEncode(value);
}
public static string DecodeHtmlEntity(this string value)
{
return WebUtility.HtmlDecode(value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment