public static Position positionAddOffset(String content, Position pos, int offset) {
        int totalOffset = positionToOffset(content, pos) + offset;
        return offsetToPosition(content, totalOffset);
    }
StringUtils
For dealing with specific problems related to Strings that represent text documents.
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/common/StringUtils.java