Alivegamer
Member
- Joined
- Jul 20, 2022
- Messages
- 10
- Programming Experience
- 1-3
I've been looking for a answer for this question for a bit and i can't find the answer.
I want to make a variable that has a string value store in it. That connects to a string value to a dictionary and get the int value of the dictionary.
^^ hopfully this can help you understand what I'm trying to ask if I can't type it right. Hopfully I'm not over thinking this.
I want to make a variable that has a string value store in it. That connects to a string value to a dictionary and get the int value of the dictionary.
C#:
Static IDictionary<string, int> Dict = new Dictionary<string, int>
{
{"Value 1", 0},
{"Value 2", 1}
};
string Variable = "Value 1";
if (Dict[Vaiirable] == 0)
{
Console.WriteLine("Equal");
};