Last element.
Precondition: array.length > 0.
string s = "Brecht"; static assert(is(typeof(s.back) == immutable char)); assert(s.back == 't'); wstring w = "Тютчев"; static assert(is(typeof(w.back) == immutable wchar)); assert(w.back == 'в'); dstring d = "Паустовский"; static assert(is(typeof(d.back) == immutable dchar)); assert(d.back == 'й');
Returns the last element of the array.
The element is returned by reference, so $(D_PSYMBOL back) can be also used to change the last element of array if it is mutable.