src/org/nutz/lang/Strings.java
public static String shiftIndent(String str, int indent, int tabWidth) {
        if (isEmpty(str))
            return str;
        if (indent <= 0)
            indent = 1;

        int n = 0;
        int i = 0;
        for (; i < str.length(); i++) {
            if (n > 0 && (n / tabWidth) >= indent)
                break;
            char c = str.charAt(i);
            if (' ' == c)
                n++;
            else if ('\t' == c)
                n += tabWidth;
            else
                break;
        }
        if (i > 0)
            return str.substring(i);
        return str;
    }
public static String shiftIndent(String str, int indent, int tabWidth) {
        if (isEmpty(str))
            return str;
        if (indent <= 0)
            indent = 1;

        int n = 0;
        int i = 0;
        for (; i < str.length(); i++) {
            if (n > 0 && (n / tabWidth) >= indent)
                break;
            char c = str.charAt(i);
            if (' ' == c)
                n++;
            else if ('\t' == c)
                n += tabWidth;
            else
                break;
        }
        if (i > 0)
            return str.substring(i);
        return str;
    }
对字符串反向缩进

@param str
给定字符串
@param indent
反向 indent 几次，如果小于等于 0 相当于 1
@param tabWidth
一个 \t 相当于几个空格，默认 4

@return 反向缩进后的字符串