I need to compare keys if they are +10 or +20 and group them before output.
Keys Value
6000 apple
6010 pear
6030 papaya
6060 banana
6090 guava
Expected Output:
Keys: 6000 - 6030
apple
pear
papaya
Keys: 6060
banana
Keys: 6090
guava
This is my code but I get an error:
string firstKeyVal;
string lastKeyVal;
foreach (KeyValuePair<string, string> kvp in Dict)
{
while(kvp.Key = kvp.Key +10 || kvp.Key + 20)
{
lastKeyVal = (kvp + 1).key;
}
}