Anonymous user
Sort using a custom comparator: Difference between revisions
→{{header|J}}
Line 252:
=={{header|J}}==
<br>Case-insensitivity is obtained using <tt>lower</tt>, a verb taken from [[Change string case]]. Standard utilities <tt>tolower</tt> or <tt>toupper</tt> may be substituted.
length_and_case =: (# ; lower)&>
strings=: 'Here';'are';'some';'sample';'strings';'to';'be';'sorted'
length_and_case mycmp strings▼
|be|to|are|Here|some|sample|sorted|strings|
▲ +---+----+------+---+--+---+----+-----+-----+--+----+----------+----------+---+-----+-----+----+
▲ +---+----+------+---+--+---+----+-----+-----+--+----+----------+----------+---+-----+-----+----+
▲ mycmp strings
=={{header|Java}}==
|