How can I remove any rows from an array and use only integers instead
string[] result = col["uncheckedFoods"].Split(',');
I have
[0] = on; // remove this string [1] = 22; [2] = 23; [3] = off; // remove this string [4] = 24;
I want to
[0] = 22; [1] = 23; [2] = 24;
I tried
var commaSepratedID = string.Join(",", result); var data = Regex.Replace(commaSepratedID, "[^,0-9]+", string.Empty);
But there is a comma before the first element, is there a better way to delete lines?
source share