Lyricdev
GitHub

interface Length

pub interface Length

How many elements a value holds: with its own Index<int>, x[^n] counts from its end.

x[^1] is x.index(x.length() - 1), x evaluated once; a write and x[^1] += 1 go through setIndex the same way. An array's, a view's and a string's ^n are built in.

Methods

fn length(): int