I have a string whose value is '12345678'. I want to assign this value to integer array like the first index of the array contains 1, the second index of array contains 2 so on. So when I write below code and execute then i received value 48 for 0 index and value 49 for second index, ascii value of my number. Declaration
int[] ArryDIReadValue = new int[DI_COUNT_CHANNEL];
string binary = Convert.ToString(portData, 2);
ArryDIReadValue = binary.Select(n => Convert.ToInt32(n)).ToArray();
Could someone please help to overcome this problem.