String indent(int spaces) { StringBuffer buffer = StringBuffer(); while (spaces > 0) { spaces--; buffer.writeCharCode(32); } return buffer.toString(); }