public static String indentBlock(String block, Indent indent)
  {
    StringBuilder sb = new StringBuilder();

    BufferedReader br = new BufferedReader(new StringReader(block));
    String line;
    try
    {
      while((line = br.readLine()) != null)
        sb.append(indent).append(line).append('\n');
    }
    catch(IOException ex)
    {
      // on a String ? I doubt...
    }

    return sb.toString();
  }
public static String indentBlock(String block, Indent indent)
  {
    StringBuilder sb = new StringBuilder();

    BufferedReader br = new BufferedReader(new StringReader(block));
    String line;
    try
    {
      while((line = br.readLine()) != null)
        sb.append(indent).append(line).append('\n');
    }
    catch(IOException ex)
    {
      
    }

    return sb.toString();
  }
public static String indentBlock ( String block , Indent indent ) { StringBuilder sb = new StringBuilder ( ) ; BufferedReader br = new BufferedReader ( new StringReader ( block ) ) ; String line ; try { while ( ( line = br . readLine ( ) ) != null ) sb . append ( indent ) . append ( line ) . append ( ' ' ) ; } catch ( IOException ex ) { // on a String ? I doubt... } return sb . toString ( ) ; }
Indents a block of text. You provide the block of text as a String and
the indent object and it returns another String with each line
properly indented.

@param block the block of text to indent
@param indent the indentation object to use
@return the indented block
Indents a block of text . You provide the block of text as a String and the indent object and it returns another String with each line properly indented .