BasicString.popBackCodeUnit

Erases the last code unit of the BasicString, effectively reducing its length by 1.

Return number of erased characters, false if string is empty or true if is not.

struct BasicString
scope pure nothrow @trusted @nogc
bool
popBackCodeUnit
()

Examples

BasicString!char str = "á1";    //'á' is encoded as 2 chars
assert(str.length == 3);

assert(str.popBackCodeUnit);
assert(str.length == 2);

assert(str.popBackCodeUnit);
assert(str.length == 1);

assert(str.popBackCodeUnit);
assert(str.empty);

assert(!str.popBackCodeUnit);
assert(str.empty);

Meta