private static String addSpaces ( String value ) { final int length = value . length ( ) ; final int lastPossibleBlock = length - 4 ; final StringBuilder sb = new StringBuilder ( length + ( length - 1 ) / 4 ) ; int i ; for ( i = 0 ; i < lastPossibleBlock ; i += 4 ) { sb . append ( value , i , i + 4 ) ; sb . append ( ' ' ) ; } sb . append ( value , i , length ) ; return sb . toString ( ) ; }
Converts a plain to a pretty printed IBAN