Decorate-sort-undecorate idiom: Difference between revisions

→‎{{header|Ruby}}: typo in code
(Added XPL0 example.)
(→‎{{header|Ruby}}: typo in code)
Line 710:
# sort by word-size, then lexical:
str = "Rosetta Code is a programming chrestomathy site seven extra words added to this demo"
p str.split.sort_by{|word| [word.size, word] }
</syntaxhighlight>
{{out}}
1,149

edits