Last active
October 26, 2024 10:06
-
-
Save garenyondem/f5b5e2319a50a126ea2db5d6670308db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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