public static Position getStringPosition(String str) {
        int lines = 0;
        int column = str.length();
        for (int i = str.length() - 1; i >= 0; i--) {
            if (str.charAt(i) == '\n') {
                if (lines == 0) {
                    column = str.length() - i - 1;
                }
                lines++;
            }
        }

        return new Position(lines, column);
    }
Indents all lines of a string except the first one by indentDelta spaces. If indentDelta is negative it will unindent.
Similar to selecting a block of text and hitting tab/shift-tab (or &lt;, &gt; in vim), but not quite equal. If you try to unindent by more spaces 
than the current indent of a line, nothing will happen.

@param text the text to modify
@param indentDelta number of spaces to add or subtract indentation.
@return the modified text
integration/schema-language-server/language-server/src/main/java/ai/vespa/schemals/common/StringUtils.java