No need to test for `!empty`, that's covered in `startIdx < s.length`.