Product Site

5.3.6.38. toString

Returns a string that contains the data of an array (one to n dimensional). The elements of the array are treated either in line or character format, starting at the first element in the array. The line format is the default. If the line format is used, a separator string can be specified. The separator will be used between concatenated elements instead of the default line end separator.

See also method makeString for which this method is a synonym.
Example 5.191. Array class — toString method
a = .array~of(1,2,3,4)  -- Loads the array

say a~toString  -- Produces: 1
                --           2
                --           3
                --           4

say a~toString("c")  -- Produces: 1234

say a~toString(, ", ")  -- Produces: 1, 2, 3, 4