Currently I'm using a HashSet of Tuples called Emoji to replace Emoji to a string representation so that for example the emoji for bomb becomes U0001F4A3
. The conversion's done via
Emoji.Aggregate(input, (current, pair) => current.Replace(pair.Item1, pair.Item2));
Works as expected.
However I'm trying to achieve the same thing without making use of predefined list of 2600+ items. Did anyone already achieve such a thing where the Emoji in a string are replaced with their counterpart without leading \?
For example:
"This string contains the unicode character bomb (đź’Ł)"
becomes
"This string contains the unicode character bomb (U0001F4A3)"