index(_:offsetBy:limitedBy:) | Apple Developer Documentation

Returns an index that is the specified distance from the given index, unless that distance is beyond a given limiting index.