method collate

Documentation for method collate assembled from the following types:

class Any

From Any

(Any) method collate

Defined as:

method collate(--> Seq)

Collate sorts taking into account Unicode grapheme characteristics; that is, sorting more or less as one would expect instead of using the order in which their codepoints appear. Collate will behave this way if the object it is applied to is Iterable.

say ('a''Z').sort# (Z a) 
say ('a''Z').collate# (a Z) 
say <ä a o ö>.collate# (a ä o ö) 
my %hash = 'aa' => 'value''Za' => 'second';
say %hash.collate# (aa => value Za => second); 

collate behavior can be changed by using the (so far experimental) $*COLLATION dynamic variable. Please refer to its description in the experimental features page for further information.