title: replace values of key value pair(A) with values of matching keys in key value pair(B)?
body: <p>I have 2 dictionaries(key value pair objects) in C#.  I want to compare dictionaries A with B and do the following <strong>for any keys that are in both dictionaries</strong>:<br>
   1. Replace the value in dictionary A with the value in dictionary B<br>
   2. Remove the matching key from dictionary B</p>
  
  <p>An example would be as follows:</p>
  
  <p>Initial dictionaries:</p>
  
  <pre><code>A={" Key1:value1 "," Key2:value2 "}
  B={" Key3:bla "," key1:hello "," Key4:bla "," Key2:world "}
  </code></pre>
  
  <p>Afterward:</p>
  
  <pre><code>A={" Key1:hello "," Key2:world "}
  B={" Key3:bla "," Key4:bla "}
  </code></pre>
  
  <p>I would like to know the best way to do this, I'm sure this can be achieved in LINQ but I am still just a beginner, any help is greatly appreciated. </p>