toLower

bachmeier no at spam.net
Thu Aug 17 14:14:00 UTC 2023


On Thursday, 17 August 2023 at 09:28:05 UTC, Joel wrote:

> I get an compile time error with sort after using toLower, 
> putting in array before sort, didn’t work:
>
>     ```d
>     void main() {
>         Import std;
>
>         "EzraTezla"
>             .to!(char[])
>             .byCodeUnit
>             .map!(std.uni.toLower)
>             .sort!"a<b"
>             .writeln;
>     }
>     ```

It works for me. Modifying your code to

```
void main() {
     import std;

     "EzraTezla"
         .to!(char[])
         .byCodeUnit
         .map!(std.uni.toLower)
         .array
         .sort!"a<b"
         .writeln;
}
```

compiles and gives the expected output. 
https://run.dlang.io/is/85VjiL


More information about the Digitalmars-d-learn mailing list