Anonymous user
Sort the letters of string in alphabetical order: Difference between revisions
Sort the letters of string in alphabetical order (view source)
Revision as of 17:09, 24 July 2021
, 2 years ago→{{header|REXX}}: added wording to the REXX section header.
m (expanded the scope of the (draft) task a little to include characters, not just letters. So that would now include digits, punctuation, blanks, and other characters.) |
m (→{{header|REXX}}: added wording to the REXX section header.) |
||
Line 54:
=={{header|REXX}}==
For REXX, it is normally faster to convert an string of characters to a one─character array of characters,
<br>sort the array, and then convert the array back to a (simple) string.
A simple bubble sort is used for this example.
The particular string used is from a typing drill devised by Charles E. Weller in the early 20th century.
<lang rexx>/*REXX program sorts an array (of any kind of items) using the bubble─sort algorithm.*/
parse arg y /*generate the array elements (items).*/
|