public String getSplitRange(String value, List<Pair<Integer, Integer>> splitList, int first, int last) {
        int lastIndex = last - 1;
        int firstIndex = first - 1;
        int splits = splitList.size();

        if (last == -1) {
            lastIndex = splits - 1;
        }
        if (firstIndex < 0 || lastIndex < 0) {
            return null;
        }
        if (firstIndex >= splits || lastIndex >= splits) {
            return null;
        }

        return value.substring(splitList.get(firstIndex).getLeft(), splitList.get(lastIndex).getRight());
    }
Find the start offset of split

@param chars The input in which we are seeking
@param split  The split number for which we are looking for the start
@return The offset or -1 if it does not exist
analyzer/src/main/java/nl/basjes/parse/useragent/utils/Splitter.java