I have a comma separated string of numbers that I need to split into an array of integers.
I tried this,
string s = "1,5,7";
int[] nums = Array.ConvertAll(s.Split(','), int.Parse);
but Visual Studio does not recognize the Array method.
I have a comma separated string of numbers that I need to split into an array of integers.
I tried this,
string s = "1,5,7";
int[] nums = Array.ConvertAll(s.Split(','), int.Parse);
but Visual Studio does not recognize the Array method.
It’s in the System namespace, so you’ll either need a using statement or you’ll need to reference it as System.Array.