contains method

bool contains(
  1. int x
)

Return true if x is in the interval [offset, offset + length].

Implementation

bool contains(int x) => offset <= x && x <= offset + length;