Convert comma separated string of ints to int array
<p>I only found a way to do it the opposite way round: create a comma separated string from an int list or array, but not on how to convert input like <code>string str = "1,2,3,4,5";</code> to an array or list of ints.</p>

<p>Here is my implementation (inspired by <a href="http://stackoverflow.com/questions/1018407/what-is-the-most-elegant-way-to-get-a-set-of-items-by-index-from-a-collection/1018624#1018624">this post by Eric Lippert</a>):</p>

<pre><code>    public static IEnumerable&lt;int&gt; StringToIntList(string str)
    {
        if (String.IsNullOrEmpty(str))
        {
            yield break;
        }

        var chunks = str.Split(',').AsEnumerable();

        using (var rator = chunks.GetEnumerator())
        {
            while (rator.MoveNext())
            {
                int i = 0;

                if (Int32.TryParse(rator.Current, out i))
                {
                    yield return i;
                }
                else
                {
                    continue;
                }
            }
        }
    }
</code></pre>

<p>Do you think this is a good approach or is there a more easy, maybe even built in way?</p>

<p><strong>EDIT:</strong> Sorry for any confusion, but the method needs to handle invalid input like <code>"1,2,,,3"</code> or <code>"###, 5,"</code> etc. by skipping it.</p>
