On Friday, 2 April 2021 at 04:54:07 UTC, Computermatronic wrote:
>On Friday, 2 April 2021 at 04:49:22 UTC, mw wrote:
>So you mean inside the writeln() call, the 0s are skipped?
Well, if I use string t
as filename, it will try to looking for a file called:
"head-abc\0\0\0-tail" instead of just "head-abc-tail" ?
or it's platform dependent?
I would imagine that it's platform dependant, but given most platforms adhere to the C ABI, and C string are null terminated, you'd end up looking for a file called "head-abc".
Ahh, I got what I see (from writeln) is not what get string here ;-)
And I just tried:
string t = text("head-", strip(s), "-tail");
It's the same behavior.
So how can I trim the leading & trailing \0
from the static char array?