accessing dictionary within another one?
-
Hi guys! This is my method signature:public static string Translate(string translationCode, string culture, Dictionary> input) i would like to know how to access the value of the 'input' dictionary within the method? e.g. if(input.ContainsKey(culture)) { if(how do I check they 'key' of the inner dictionary?) { //use the value of the inner dictionary then how would i access the value of the inner dictionary } } I hope this makes sense. Thanks
-
Hi guys! This is my method signature:public static string Translate(string translationCode, string culture, Dictionary> input) i would like to know how to access the value of the 'input' dictionary within the method? e.g. if(input.ContainsKey(culture)) { if(how do I check they 'key' of the inner dictionary?) { //use the value of the inner dictionary then how would i access the value of the inner dictionary } } I hope this makes sense. Thanks
-
Hi guys! This is my method signature:public static string Translate(string translationCode, string culture, Dictionary> input) i would like to know how to access the value of the 'input' dictionary within the method? e.g. if(input.ContainsKey(culture)) { if(how do I check they 'key' of the inner dictionary?) { //use the value of the inner dictionary then how would i access the value of the inner dictionary } } I hope this makes sense. Thanks
Just apply every operation to the inner dictionary to
input[culture]
:if(input.ContainsKey(culture))
{
if(input[culture].ContainsKey(innerDictionaryKey))
{
string theValueYouWant = input[culture][innerDictionaryKey];
}
}