 <p>There are several ways to achieve what you want as the other answers point out. If you want a bit of safety checking then I'd use <code>TryParse</code>:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; public class Program { public static void Main() { var test = "1 2 3 x"; var values = test.Split(new [] {' '}, StringSplitOptions.RemoveEmptyEntries); var results = new List&lt;int&gt;(); foreach(var value in values) { int x; if(Int32.TryParse(value, out x)) { results.Add(x); } else { Console.WriteLine("{0} is not an integer", value); } } } } </code></pre>