c# - How to get from Dictionary<char, Tuple <int, char>> int value for specific key? -


i have 2 dictionaries in first case used tuple key values , works fine

dictionary<tuple<char, char>, int> pairpoints = new dictionary<tuple<char, char>, int>(); foreach (var items in this.pairpoints)    console.writeline(items.key.item1); 

but in second case want value in tuple {int,char} cant find result.values.item1

dictionary<char, tuple <int, char>> result = new dictionary<char, tuple<int, char>>(); if(distance < result.values.item1) {//do things} 

is possible write or have use different array method?

result.values collection of tuple<int, char> can access single item in collection dictionary key:

result[somechar].item1 

or can loop though values follows:

foreach(var tuple in result.values)     console.writeline(tuple.item1) 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -