explode( item )

Returns the components of the supplied item. The function returns one result for each component. The function understands many different types of argument, as described below:

lists
each item in the list
:-) explode( { 1, 2, 3 } );
There are 3 results
1
2
3
          
maps
each value in the map
:-) explode( newMap( "hello" ==> "there", "whats" ==> "that" ) );
There are 2 results
"there"
"that"
          
which is much the same as
:-) var map = newMap( "hello" ==> "there", "whats" ==> "that" );
There are 0 results
:-) map.mapValuesList.explode;
There are 2 results
"there"
"that"
          
strings
each character in the string
:-) "hello".explode;
There are 5 results
'h'
'e'
'l'
'l'
'o'
          
maplet
the left then the right item in the pair
:-) explode( newMaplet( "key", "value" ) );
There are 2 results
"key"
"value"
          
XML
each child of the XML element
:-) explode( <element>"hello", 2, <blah><child/></blah>, 72, "what"</element> );
There are 5 results
"hello"
2
<blah><child/></blah>
72
"what"
          

It's also worth noting that MillScript can explode any Java object that it can view as a Collection.