print ubyte[] as (ascii) string

eugene dee0xeed at gmail.com
Thu Dec 30 17:34:54 UTC 2021


On Thursday, 30 December 2021 at 17:16:10 UTC, Tejas wrote:
> I'll need to know the error message

There is none, see example in my prev message

> because the following works:
> ```d
> import std;
> void main()
> {
>     ubyte[] c ;
>     c.length = 100;
>     char[] arr = cast(char[])c[0 .. $];
>     foreach(ref elem; arr)
>         elem = 'a';
>     writeln(arr.strip);
> }
> ```

There is nothing to strip here (spaces, new lines...).



More information about the Digitalmars-d-learn mailing list