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:27, 22 October 2021
, 2 years ago→{{header|C#|CSharp}}
(Ada version) |
|||
Line 136:
var omit_spaces = true;
var str = "forever ring programming language";
Console.Write( "working..." + nl );
Console.Write( "Sort the letters of string in alphabitical order:" + nl );
Console.Write( "Input: " + str + nl );
Console.Write( "Output: " );
for (var ch = omit_spaces ? 33 : 0; ch < 256; ch++)
foreach (var itm in str)
if (ch == itm) Console.Write(itm);
Console.Write( nl + "done..." );
}
}</lang>
|