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

m
Undo revision 345366 by DANILIN (talk) since "using static System.Console;" is being used, the "Console." in "Console.Write..." is redundant.
m (Undo revision 345366 by DANILIN (talk) since "using static System.Console;" is being used, the "Console." in "Console.Write..." is redundant.)
Line 254:
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>