BasicString.clear

Erases the contents of the BasicString, which becomes an empty string (with a length of 0 characters).

Doesn't change capacity of string.

struct BasicString
scope pure nothrow @trusted @nogc
void
clear
()

Examples

BasicString!char str = "123";

str.reserve(str.capacity * 2);
assert(str.length == 3);

const size_t cap = str.capacity;
str.clear();
assert(str.capacity == cap);

Meta