Sort the letters of string in alphabetical order: Difference between revisions

Added solution for Action!
(→‎{{header|Common Lisp}}: Added Common Lisp version)
(Added solution for Action!)
Line 14:
Write the function even if your language has a built-in function for it.
<br><br>
 
=={{header|Action!}}==
{{libheader|Action! Tool Kit}}
<lang Action!>INCLUDE "D2:SORT.ACT" ;from the Action! Tool Kit
 
PROC Test(CHAR ARRAY s)
PrintF("Original:%E""%S""%E%E",s)
SortB(s+1,s(0),0)
PrintF("Sorted:%E""%S""%E%E",s)
RETURN
 
PROC Main()
Put(125) PutE() ;clear the screen
Test("The quick brown fox jumps over the lazy dog, apparently")
Test("Now is the time for all good men to come to the aid of their country.")
RETURN</lang>
{{out}}
[https://gitlab.com/amarok8bit/action-rosetta-code/-/raw/master/images/Sort_the_letters_of_string_in_alphabetical_order.png Screenshot from Atari 8-bit computer]
<pre>
Original:
"The quick brown fox jumps over the lazy dog, apparently"
 
Sorted:
" ,Taaabcdeeeefghhijkllmnnoooopppqrrrsttuuvwxyyz"
 
Original:
"Now is the time for all good men to come to the aid of their country."
 
Sorted:
" .Naaccddeeeeeeffghhhiiiillmmmnnooooooooorrrstttttttuwy"
</pre>
 
=={{header|Ada}}==
Anonymous user