How to convert a jagged array of bytes into a single dimension. Example byte[][] s1_byte
. Convert it into byte[]
.
Asked
Active
Viewed 1,198 times
-4

vaibhav
- 41
- 9
-
byte[][] is a jagged array and byte[ , ] is two dimentional. – BjarkeCK Jun 09 '15 at 06:05
-
how do i convert a jagged array to an single byte array – vaibhav Jun 09 '15 at 21:26
1 Answers
1
try it with SelectMany
int[][] i = new[] {new[]{1,1},new[]{2,2}}; // [1,1],[2,2]
int[] result = i.SelectMany(x => x).ToArray(); // [1,1,2,2]

fubo
- 44,811
- 17
- 103
- 137