Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

dictionary increment

var dictionary = new Dictionary<char,int>();
foreach (var character in myString.ToUpper())
{
    if (dictionary.ContainsKey(character)) 
    {
        dictionary[character]++;
    }
    else
    {
        dictionary.Add(character, 1);
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #dictionary #increment
ADD COMMENT
Topic
Name
2+4 =