Function BasicString.frontCodeUnit

Returns the first character(utf8: char, utf16: wchar, utf32: dchar) of the BasicString.

BasicString.CharType frontCodeUnit() const pure nothrow @nogc @property scope @trusted;

BasicString.CharType frontCodeUnit (
  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.frontCodeUnit == '1');
}

{
	BasicString!char str = "á23";

	immutable(char)[2] a = "á";
	assert(str.frontCodeUnit == a[0]);
}

{
	BasicString!char str = "123";

	str.frontCodeUnit = 'x';

	assert(str == "x23");
}