Function String.toStringz

Returns null-terminated string. The returned string is managed by this object and shouldn't be freed.

const(char)* toStringz() pure nothrow @nogc;

Returns

Null-terminated string.

Example

auto s = String("C string.");
assert(s.toStringz()[0] == 'C');
assert(s.toStringz()[9] == '\0');