public TextEditor indent ( int spaces ) { StringBuilder sb = new StringBuilder ( spaces ) ; for ( int i = 0 ; i < spaces ; i ++ ) { sb . append ( ' ' ) ; } return replaceAll ( "^" , sb . toString ( ) ) ; }
Introduce a number of spaces at the start of each line .