Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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;
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #increase #dictionary #key
ADD COMMENT
Topic
Name
5+9 =