Function BasicString.backCodeUnit
Returns the last character(utf8: char
, utf16: wchar
, utf32: dchar
) of the BasicString
.
BasicString . CharType backCodeUnit() const pure nothrow @nogc @property scope @trusted;
BasicString . CharType backCodeUnit
(
const BasicString . CharType val
) pure nothrow @nogc @property scope @trusted;
This function shall not be called on empty strings.
Examples
{
BasicString!char str = "123";
assert(str .backCodeUnit == '3');
}
{
BasicString!char str = "12á";
immutable(char)[2] a = "á";
assert(str .backCodeUnit == a[1]);
}
{
BasicString!char str = "123";
str .backCodeUnit = 'x';
assert(str == "12x");
}