A
A
AlexGenesis2022-01-04 19:55:03
C++ / C#
AlexGenesis, 2022-01-04 19:55:03

How to decompose a multidimensional array into sub-arrays in C#?

Let's say I have the following 3D array:

A = { { {{0, 1, 2}, {3, 4, 5} }, { {6, 7, 8}, {9, 10, 11} }, { { 12, 13, 14}, {15, 16, 17} } }

Does C# have any built-in tools to extract the following array from array A:

B = {0, 1, 2} or = {{0, 1 , 2}, {3, 4, 5} }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kiri444, 2022-01-05
@kiri444

It is possible to define lengths of measurements and to use foreach. If it's difficult, make a function out of it yourself and use it)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question