BasicString.frontCodeUnit

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

This function shall not be called on empty strings.

  1. CharType frontCodeUnit [@property getter]
  2. CharType frontCodeUnit [@property setter]
    struct BasicString
    @property scope pure nothrow @trusted @nogc
    frontCodeUnit
    ()

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

Meta