That's what toStringz is for, and it'll avoid appending the
'\0' if it can
(e.g. if the code unit one past the end of the string is '\0'
as it is with
string literals).
I actually have a different question related to this now that I
think about it. Is there a similar function to go from a '\0'
terminated char* to a D string? Lately I have been using
std.conv.text, but I have also made a function that just parses
the pointer and copies its data into a string. I'm actually kind
of surprised that there isn't anything built into the string
class like this.