title: Count All Character Occurrences in a String C#
body: <p>What is the best way to dynamically count each character occurrence in C#?</p>
  
  <p>given</p>
  
  <pre><code>string sample = "Foe Doe";
  </code></pre>
  
  <p>it should output something like</p>
  
  <pre><code>f = 1
  o = 2
  e = 2
  d = 1
  </code></pre>
  
  <p>counting a single character would be easy but in my exam this was a bit tricky, I could only imagine a solution to get all unique characters -> then store it in a collection(preferably an array) then a nested for loop for the array and the string.</p>
  
  <p>Is there a better solution than this?</p>