Improve formatting of multidimensional arrays
See original GitHub issueWhen calling Formatter.ToString(object)
on a jagged array such as
new int[][]
{
new[] { 1, 2 },
new[] { 3, 4 }
};
the output contains the nested structure as expected.
{{1, 2}, {3, 4}}
Calling Formatter.ToString(object)
on a multidimensional array such as
new int[,]
{
{ 1, 2 },
{ 3, 4 }
};
gives an unexpected (and perhaps confusing) visual result, as it doesn’t contain the nested structure.
{1, 2, 3, 4}
This could probably be improved by introducing a new MultidimensionalArrayFormatter
which checks if the object
is an Array
and has Rank >= 2
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Formatting Multi dimensional arrays Python
How can I write a code that changes the values of each individual arrays within the multidimensional array a to zeroes right after...
Read more >Multidimensional Arrays in Java
Representation of 2D array in Tabular Format: A two – dimensional array can be seen as a table with 'x' rows and 'y'...
Read more >Row- and column-major order
In computing, row-major order and column-major order are methods for storing multidimensional arrays in linear storage such as random access memory.
Read more >How to Create and Manage Multidimensional Arrays Using ...
In this article we will get more detailed into arrays, how they work, creating multidimensional arrays, and looping through them to work with...
Read more >Visual Basic Multidimensional Arrays
In visual basic, Multidimensional Arrays can be declared by specifying the data type of an elements followed by the brackets () with comma...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Nah. I don’t think we mention the exact output anywhere else.
Fixed in #1044