if (length == 0) buffer.append('\n');
    public static String trim(String content) {        if (content == null)            return null;        if (content.length() == 0)            return content;        TextScanner scanner = new TextScanner(content);        int lines = scanner.getLineCount();        if (lines == 0)            return "";        else if (lines == 1) {            String r = scanner.getLine(0);            if (r.length() == 0)                return "\n";            return scanner.getLine(0);        }        StringBuffer buffer = new StringBuffer();        int length = 0;        for (int i = 0; i < lines; i++) {            if (i > 0)                buffer.append('\n');            length = scanner.appendLine(buffer, i);        }        if (length == 0)            buffer.append('\n');        return buffer.toString();    }