When I want to play with Emojis in C#, I build a helper class just like this:
public class Emoji
{
readonly int[] codes;
public Emoji(int[] codes)
{
this.codes = codes;
}
public Emoji(int code)
{
codes = new int[] { code };
}
public override string ToString()
{
if (codes == null)
return string.Empty;
var sb = new StringBuilder(codes.Length);
foreach (var code in codes)
sb.Append(Char.ConvertFromUtf32(code));
return sb.ToString();
}
}
This way, I can just do string monkeyEmoji = new Emoji(0xF64A);
It also supports emojis with multiple code points (yes, those exist and are a pain)