I think it would be good if you could post an overview of how you're using this data in practice, and to define how/when the data needs to be in the special delimited string format (e.g. is that only used for loading/saving?).
If the string formatted data is only required for saving and loading as a text file, it would be better to build "convert to Ruby array" and "convert to text" modules, and then do as much as possible "internal" processing on the native Ruby arrays - with appropriate "convert to green" modules only where necessary.
The main advantage is speed - parsing strings is always a relatively slow process, so avoiding unnecessary string<->array conversions would make everything run much better.
It would also make many of the Ruby codes much smaller and potentially easier to understand and adapt. For example, for a true "nested array" format, it is much simpler to construct a set of modules to manipulate the data - e.g. "get row" module, "get column", "get cell", "parse from text"... etc...
Such modules would be useful for anyone who needed to use 2D arrays for any purpose, and only "string -> 2D array" and "2D array -> string" modules need to be customised for each application.
tester wrote:I don't know what is the reason of this confusion.
I think that this relates partly to the above comment. You are asking for solutions to small parts of the problem as you encounter each one, but it is hard to solve them fully without knowing the context. So, I think there is some confusion for the "helpers" too - at each step we are unsure if the input or output data should be Arrays, nested Arrays, delimited strings etc. We then post only partial solutions which do not work when placed into context, which probably then adds to your confusion - and so we go round in circles all confusing each other.
Another problem is that it's much easier to make the Ruby codes once things are in a native Ruby format. Ironically, trying to keep too much stuff in "green" (because you understand it better), is precisely what is making the Ruby stuff so complex (requiring even greater Ruby knowledge - for you and also for your "helpers").
So we should begin by identifying the places where "green" is necessary, to link up with other parts of the schematic - but other places, where "2D array" modules connect only with each other, where "white" Ruby links would be more simple.