I have a string that has numbers
string sNumbers = \"1,2,3,4,5\";
I can split it then convert it to List
List
Better use int.TryParse to avoid exceptions;
int.TryParse
var numbers = sNumbers .Split(',') .Where(x => int.TryParse(x, out _)) .Select(int.Parse) .ToList();