title: .indexOf for multiple results
body: <p>Let's say I have a text and I want to locate the positions of each comma. The string, a shorter version, would look like this:</p>
  
  <pre><code>string s = "A lot, of text, with commas, here and,there";
  </code></pre>
  
  <p>Ideally, I would use something like:</p>
  
  <pre><code>int[] i = s.indexOf(',');
  </code></pre>
  
  <p>but since indexOf only returns the first comma, I instead do:</p>
  
  <pre><code>List&lt;int&gt; list = new List&lt;int&gt;();
  for (int i = 0; i &lt; s.Length; i++)
  {
     if (s[i] == ',')
        list.Add(i);
  }
  </code></pre>
  
  <p>Is there an alternative, more optimized way of doing this?</p>