sort a string
notna
notna.remove.this at ist-einmalig.de
Fri May 1 15:29:08 UTC 2020
On Friday, 1 May 2020 at 15:15:29 UTC, bachmeier wrote:
> On Friday, 1 May 2020 at 15:04:01 UTC, notna wrote:
>> On Friday, 1 May 2020 at 12:29:26 UTC, Steven Schveighoffer
>> wrote:
>>
>>>>> dchar[] line3 = sort(line2.to!(dchar[]));
>>>
>>> dchar[] line3 = sort(line2.to!dchar[]).release;
>>>
>>> https://dlang.org/phobos/std_range.html#.SortedRange.release
>>>
>>
>> hmmm, whích results in:
>> Error: cannot use [] operator on expression of type dchar
>
> Working program:
>
> import std.algorithm, std.conv, std.string, std.stdio;
>
> void main() {
> string word = "bar";
> string line2 = toLower!(string)(word);
> dchar[] line3 = sort(line2.to!(dchar[])).release;
> writeln(line3);
> }
>
> You need to add parens.
well, this makes very much sense ;)
THANKS a lot, works and helped to adopt some old code
More information about the Digitalmars-d-learn
mailing list