Difference between revisions of "Array.pack()"

From ZCubes Wiki
Jump to navigation Jump to search
Line 7: Line 7:
  
 
Remove consecutive duplicates and compact the array.
 
Remove consecutive duplicates and compact the array.
 +
 +
Example:
  
 
[1,2,3,[3,4,4],[3,4,4],3].pack()
 
[1,2,3,[3,4,4],[3,4,4],3].pack()
  
{| style="" id="TABLE1" class="null" donotcaption="true" | |- | 1 |- | 2 |- | 3 |- | 3 | 4 |- | 3     |}
+
{| style="" id="TABLE2" class="null" donotcaption="true" |  
 +
|-  
 +
| 1  
 +
 
 +
|-  
 +
| 2  
 +
 
 +
|-  
 +
| 3  
 +
 
 +
|-  
 +
| 3  
 +
| 4  
 +
 
 +
|-  
 +
| 3  
 +
 
 +
 
 +
|}

Revision as of 18:44, 5 February 2020


Array.pack()

Remove consecutive duplicates and compact the array.

Example:

[1,2,3,[3,4,4],[3,4,4],3].pack()

1
2
3
3 4
3