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:47, 8 June 2022
, 1 year agoUndo 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";
for (var ch = omit_spaces ? 33 : 0; ch < 256; ch++)
foreach (var itm in str)
if (ch == itm) Console.Write(itm);
}
}</lang>
|