Reputation: 9457
I'm trying to convert a single list to a multi-dimensional Array2D. Basically go from [1; 2; 3]
to [[1; 2; 3]]
. I can't just use List.toArray
as I'm using an API function which takes an int[,]
as one of its inputs.
What's the best way to do this?
Upvotes: 4
Views: 399
Reputation: 47904
Just nest the list within another list:
array2D [[1; 2; 3]]
> val it : int [,] = [[1; 2; 3]]
Upvotes: 6