title: string.indexof not working as expected
body: <p>I got a problem with the <code>string.IndexOf</code> method.<br>
  I have a string containing multiple substrings I want to extract.<br>
  Example:</p>
  
  <pre><code>key=muchdata&amp;key=muchdata&amp;key=muchdata
  </code></pre>
  
  <p>that is the simplified structure of the input string.<br>
  <code>muchdata</code> can contain every A-Za-z0-9 and special characters like !"§$%&amp;/()=?<br></p>
  
  <p>I would like to get the data between all <code>key=</code> strings.<br></p>
  
  <p>First I wanted to use a regex but I wasn't able to create one that worked.
  Then I thought about using <code>string.IndexOf</code>.<br>
  So I did something like this:</p>
  
  <pre><code>int start = input.IndexOf("key=");
  int end = input.IndexOf("&amp;key=");
  string sub = input.Substring(start, end);
  </code></pre>
  
  <p>Unfortunately that didn't work as expected. Sometimes it even returned a substring but about 30 characters to long.<br>
  I built in some more code to check if <code>end == -1</code> if I reached the end so that I just got the last substring from <code>start</code> to the end of the whole string.<br></p>
  
  <p>I really have no clue what to do next :(<br>
  What am I missing / doing wrong?</p>