I want output like this in the C#. I really want to know. please
int a = 12345;
int[] B = new int[5];
I want output Like:
0 : 1;
1 : 2;
2 : 3;
3 : 4;
4 : 5;
I want output like this in the C#. I really want to know. please
int a = 12345;
int[] B = new int[5];
I want output Like:
0 : 1;
1 : 2;
2 : 3;
3 : 4;
4 : 5;
you could use:
int a = 12345;
int[] B = a.ToString().ToCharArray().Select(ch => Convert.ToInt32(ch.ToString())).ToArray();
or
int a = 12345;
int[] B = a.ToString().ToCharArray().Select(ch => int.Parse(ch.ToString())).ToArray();