I have a C# application where I am saving off my array into an integer value, which is working.
here is my array: int[] myArray = { 0, 1, 3, 15 };
However, when I try to convert myArray to see what values it has it returns the following {1, 3, 1, 5} as you can see it doesn’t get the 0, and it separates the 15 into {1, 5}.
Here is my approach:
double[] array = { 0, 1, 3, 15 };
var result = string.Concat(array);
int resultNumber = int.Parse(result); // returns 1315
int[] resultToArray = resultNumber.ToString().Select(o => Convert.ToInt32(o) - 48).ToArray();
What am I missing from my resultToArray?