convert char array to int array c#

arrays, c#, char, int

Solution

Another option, using `Array.ConvertAll` and `Char.GetNumericValue`:

int[] Aint = Array.ConvertAll(A, c => (int)Char.GetNumericValue(c));

Problem

I have this array ``` char[] A = ['1', '2', '3', '4'] ``` And I want to convert it to int[] ``` int[] Aint=[1, 2, 3, 4] ``` Any ideas? I just started programming Thanks

Original source

Related problems