Answers for "increase value in dictionary against a key in c#"

C#
0

increase value in dictionary against a key in c#

public static void Increment<T>(this Dictionary<T, int> dictionary, T key)
    {
        int count;
        dictionary.TryGetValue(key, out count);
        dictionary[key] = count + 1;
    }
Posted by: Guest on February-25-2021

Code answers related to "increase value in dictionary against a key in c#"

C# Answers by Framework

Browse Popular Code Answers by Language