This is my function where I created a dictionary:
public int Scale(string value)
{
//some calculs
int result = 19; // or int between 0 and 40
this.stringToInt = new Dictionary<string, int>()
{
{"1p",00},{"2p",01},{"3p",03} ... {"300p",40}
};
// Here I try to do something like that: if(result == (int in dictionary) return associate string
}
I tried the below code:
if (this.stringToInt.ContainsValue(result)
{
return this.stringToInt[result]; // I don't know what to write between hook (result doesn't work).
}
I don't know how to return associate string.
Thank you in advance for help!