sorting a string

Namal via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jul 14 08:06:10 PDT 2017


Is there a 'easy' way to sort a string in D like it is possible 
in Python? Also how can I remove whitespace between characters if 
I am reading a line from a file and safe it as a string?

     string[] buffer;

     foreach (line ; File("test.txt").byLine)
         buffer ~= line.to!string;


More information about the Digitalmars-d-learn mailing list