Function BasicString.popBackCodeUnit

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

bool popBackCodeUnit() pure nothrow @nogc scope @trusted;

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

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);