Guest User

Untitled

a guest
Jan 17th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. public List<Tuple<string, string, int>> SetNumAttrb(Dictionary<string, string[]> dic)
  2. {
  3. List<Tuple<string, string, int>> attNumNom = new List<Tuple<string, string, int>>();
  4. int ctrl = 1;
  5. foreach (KeyValuePair<string, string[]> kvp in dic)
  6. {
  7. for (int i = 0; i < kvp.Value.Length; i++)
  8. {
  9. attNumNom.Add(Tuple.Create<string, string, int>(kvp.Key, dic[kvp.Key][i], ctrl));
  10. ctrl++;
  11. }
  12. }
  13. return attNumNom;
  14. }
  15.  
  16. List<Tuple<string, string, int>> list = SetNumAttrb(dict);
  17.  
  18. foreach (var tuple in list)
  19. {
  20. Console.WriteLine("{0} - {1} - {2}", tuple.Item1, tuple.Item2, tuple.Item3.ToString());
  21. }
  22.  
  23. Console.WriteLine(string.Join("rn", attNumNom));
Add Comment
Please, Sign In to add comment