title: C# Split a string of integers into an IEnumerable<int>
body: <p>I need to convert a string of comma separated integers into a list of integers.</p>
  
  <p>What is the best way to do this?</p>
  
  <p>I can do it below but am worried about the performance - Is there a better more efficient way to do this?</p>
  
  <pre><code>public IEnumerable&lt;int&gt; GetListOfIds()
  {
      string Ids = "1,4,5,7,12"; // would be passed into method
      List&lt;int&gt; _result = Ids.Split(',')
                             .ToList()
                             .Select(item =&gt; int.Parse(item))
                             .ToList();
  
      return _result;
  }
  </code></pre>