public static String unexpand ( CharSequence self , int tabStop ) { String s = self . toString ( ) ; if ( s . length ( ) == 0 ) return s ; try { StringBuilder builder = new StringBuilder ( ) ; for ( String line : readLines ( ( CharSequence ) s ) ) { builder . append ( unexpandLine ( line , tabStop ) ) ; builder . append ( "\n" ) ; } // remove the normalized ending line ending if it was not present if ( ! s . endsWith ( "\n" ) ) { builder . deleteCharAt ( builder . length ( ) - 1 ) ; } return builder . toString ( ) ; } catch ( IOException e ) { /* ignore */ } return s ; }
Replaces sequences of whitespaces with tabs .