Skip to content

Instantly share code, notes, and snippets.

@jirolabo
Created May 20, 2018 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jirolabo/8b671cb71945c0f5aa01c81cc0ca576d to your computer and use it in GitHub Desktop.
Save jirolabo/8b671cb71945c0f5aa01c81cc0ca576d to your computer and use it in GitHub Desktop.
Combining Dictionary
Dim dictA = New Dictionary(Of String, String) From {{"hoge", "fuga"}}
Dim dictB = New Dictionary(Of String, String) From {{"foo", "bar"}}
Dim dictC = dictA.Concat(dictB).ToDictionary(Function(i) i.Key, Function(i) i.Value)
For Each item In dictC
Console.WriteLine($"{item.Key} {item.Value}")
Next
var dictA = new Dictionary<string, string> { { "hoge", "fuga" } };
var dictB = new Dictionary<string, string> { { "foo", "bar" } };
var dictC = dictA.Concat(dictB).ToDictionary(i => i.Key, i => i.Value);
foreach (var item in dictC)
{
Console.WriteLine($"{item.Key} {item.Value}");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment