nu_terminate

Appends a null terminator at the end of the string, resizes the memory allocation if need be.

@nogc @system
inout(T)[]
nu_terminate
(
T
)
(
ref inout(T)[] text
)
if (
is(T == char) ||
is(T == wchar)
||
is(T == dchar)
)

Parameters

text inout(T)[]

string to add a null-terminator to, in-place

Memorysafety: This function is not memory safe, in that if you attempt to use it on string literals it may lead to memory corruption or crashes. This is meant to be used internally. It may reallocate the underlying memory of the provided string, as such all prior string references should be assumed to be invalid.

Return Value

Type: inout(T)[]

Slice of the null-terminated string, the null terminator is hidden.

Meta