I have a string that has numbers
string sNumbers = \"1,2,3,4,5\";
I can split it then convert it to List
You can use new C# 6.0 Language Features:
(s) => { return Convert.ToInt32(s); } with
corresponding method group Convert.ToInt32 new Converter(Convert.ToInt32) with: Convert.ToInt32The result will be:
var intList = new List(Array.ConvertAll(sNumbers.Split(','), Convert.ToInt32));