sort with char’s
Steven Schveighoffer
schveiguy at gmail.com
Sun Aug 13 00:20:03 UTC 2023
On Saturday, 12 August 2023 at 06:47:50 UTC, Joel wrote:
> writeln(name[].each!(n => n.write)); // get
> "christensenyes" //, " <> ", name[].sort!"a>b".each!(n =>
> n.write));
This writes each character individually, and then at the end
writes the result of `each` with a newline.
In this case, `each`
[docs](https://dlang.org/phobos/std_algorithm_iteration.html#each) say:
Returns:
Yes.each if the entire range was iterated, No.each in case of
early stopping.
`Yes.each` is going to print as "yes".
-Steve
More information about the Digitalmars-d-learn
mailing list