[Issue 17180] New: to!string('\0') makes "\0" which breaks concatination

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Feb 13 19:33:49 PST 2017


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

          Issue ID: 17180
           Summary: to!string('\0') makes "\0" which breaks concatination
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: jiki at red.email.ne.jp

import std.conv;
import std.stdio;

void main() {
  char c = 0;
  string s = to!string(c);

  writeln(`"` ~ s ~ `"` ); stdout.flush(); // the last quate GONE
  assert(s.length == 0 || s[0] != '\0');
}


# We want one of these, at least.

* Empty string
* Alternative character or message
* Raising an error

--


More information about the Digitalmars-d-bugs mailing list