String.opIndex

  1. inout(char) opIndex(size_t pos)
    struct String
    ref inout @nogc nothrow pure @trusted
    inout(char)
    opIndex
    (
    const size_t pos
    )
  2. ByCodeUnit!char opIndex()
  3. ByCodeUnit!(const char) opIndex()

Parameters

pos size_t

Position.

Return Value

Type: inout(char)

Byte at pos.

Precondition: length > pos.

Examples

auto s = String("Alea iacta est.");
assert(s[0] == 'A');
assert(s[4] == ' ');

Meta