Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Implementation edit is for fixing errors and enhancing with metadata.

Instead of changing the code of the snippet, consider creating another D implementation.

Other implementations
x := items[len(items)-1]
const x = items[items.length - 1];
x = items.last
x = items.last
x = items[-1]
x := items[high(items)];
val x = items.takeRight(1)
foo :: [a] -> Maybe a
foo [] = Nothing
foo xs = Just $ last xs

x = foo items
import std.range;
int[] items;
auto x = items.back();
x = items.last;
local x = items[#items]
let x = items[items.len()-1];
my $x = $items[-1];
$x = end($items);
let x = items.last().unwrap();
using System.Linq;
var x = items.LastOrDefault();
x = List.last(items)
int x = items[items.length - 1];
x = lists:last(items),
x = last items
(def x (last items))
std::vector<int> items;
int last = items.back();
x = items(ubound(items,1))
var x = items.last()
$x = $items[array_key_last($items)];
#include <iterator>
auto x = *std::crbegin(items);
my $x = $items[$#items];
Dim ItemList As New List(Of String)(New String() {"one", "two", "three"})
(def x (peek items))
var x = items[items.Count-1];
@import Foundation;