Guest User

Untitled

a guest
Dec 10th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. private void Button_Click(object sender, RoutedEventArgs e)
  2. {
  3. Emoji bikingEmoji = new Emoji(0x1F6B4);
  4.  
  5. MessageBox.Show("Hello there is " + bikingEmoji);
  6.  
  7. }
  8.  
  9. public class Emoji
  10. {
  11. readonly int[] codes;
  12. public Emoji(int[] codes)
  13. {
  14. this.codes = codes;
  15. }
  16.  
  17. public Emoji(int code)
  18. {
  19. codes = new int[] { code };
  20. }
  21.  
  22. public override string ToString()
  23. {
  24. if (codes == null)
  25. return string.Empty;
  26.  
  27. var sb = new StringBuilder(codes.Length);
  28.  
  29. foreach (var code in codes)
  30. sb.Append(Char.ConvertFromUtf32(code));
  31.  
  32. return sb.ToString();
  33. }
  34. }
Add Comment
Please, Sign In to add comment