[Issue 21843] New: std.format could support %{x,X} for ubyte[]

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 18 18:22:47 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21843

          Issue ID: 21843
           Summary: std.format could support %{x,X} for ubyte[]
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: pro.mathias.lang at gmail.com

```
import std;

void main ()
{
    ubyte[] data = [42, 69, 250];
    writefln("%X", data);
}
```

This currently throws an Exception. I think it could print `2A45FA`. This would
be very handy to save on space when printing large ubyte arrays. This is an
enhancement request, as there is nothing wrong with the current behavior.

--


More information about the Digitalmars-d-bugs mailing list