String substringFirstOf(int digit) { final position = min(digit, length); return substring(0, position); }