mydictionary[key] = value;
if (mydictionary.ContainsKey(key))
{
mydictionary[key] += value;
//or
mydictionary[key] = value;
}
else
{
mydictionary.Add(key, value);
}
mydictionary[key] = value;
if (mydictionary.ContainsKey(key))
{
mydictionary[key] += value;
//or
mydictionary[key] = value;
}
else
{
mydictionary.Add(key, value);
}
No comments:
Post a Comment