I have this array
char[] A = [\'1\', \'2\', \'3\', \'4\']
And I want to convert it to int[]
int[] Aint=[1, 2, 3, 4]
Add a using statement for using System.Linq; then you can do the following:
using System.Linq;
int[] Aint = A.Select(i => Int32.Parse(i.ToString())).ToArray();
You will get an exception if an element in A cannot be parsed.
A