public static String indent(String iString,int iIndentDepth){
  StringBuilder spacer=new StringBuilder();
  spacer.append("\n");
  for (int i=0; i < iIndentDepth; i++) {
    spacer.append("  ");
  }
  return replace(iString,"\n",spacer.toString());
}

public static String indent ( String iString , int iIndentDepth ) { StringBuilder spacer = new StringBuilder ( ) ; spacer . append ( "\n" ) ; for ( int i = 0 ; i < iIndentDepth ; i ++ ) { spacer . append ( "  " ) ; } return replace ( iString , "\n" , spacer . toString ( ) ) ; }
indents the given string per line .
