Hi!
Question: How do I combine three strings into one AND use it as Unicode? The need for \ messes everything up.
string prefix = @"\U0001F0";
string hexSuit = "A";
string hexValue = "B";
I want to put together these three strings into "\U0001F0AB" that's actually usable as Unicode in C#.
Is there a way to do this?
Background: I'm making a card game in Forms. It will have two enums, Suit and Value, for the cards, which I convert to hex in order to get the corresponding character in Unicode (page two: [https://www.unicode.org/charts/PDF/U1F0A0.pdf although I will use 52 cards, not 56)
In the example above, (int)suit equals 10, which gets converted to A in hex, and (int)value equals 11, which is B in hex. This gives me the Jack of spades character. Everything works as expected when hardcoding "\U0001F0AB" into Form1.
I know I could solve this with an x52 Switch, or just use images, but I haven't given up this just yet.
public enum Suit
{
Spades = 10,
Hearts,
Diamonds,
Clubs
}
public enum Value
{
Ace = 1,
Two,
Three,
Four,
Five,
Six,
Seven,
Eight,
Nine,
Ten,
Jack,
Queen,
King
}