Sort the letters of string in alphabetical order: Difference between revisions
Sort the letters of string in alphabetical order (view source)
Revision as of 19:32, 17 May 2023
, 1 year agoK
No edit summary |
(K) |
||
Line 936:
</pre>
=={{header|K}}==
{{works with|ngn/k}}<syntaxhighlight lang=K>{x@<_x}"This is a test"
" aehiisssTtt"
{x@<_x}"The sentence \"The quick brown fox jumps over the lazy dog\" uses every letter of the alphabet."
" \"\".aaabbccdeeeeeeeeeeeeeeffghhhhhijklllmnnnoooooppqrrrrssssTtTtttttuuuvvwxyyz"
{x@<x}"This is a test" / remove the _ to sort in ascii order rather than alphabetic order
" Taehiissstt"</syntaxhighlight>
=={{header|Lua}}==
<syntaxhighlight lang="lua">fcoll = {} -- forward collation
|