Possible Duplicate:
Split string, convert ToList<int>() in one line
Convert comma separated string of ints to int array
I have a string like:
string test = "1,2,3,4";
Is there any easier way (syntactically) to convert it to a List<int>
equivalent to something like this:
string[] testsplit = test.Split(',');
List<int> intTest = new List<int>();
foreach(string s in testsplit)
intTest.Add(int.Parse(s));