private String convertString ( String str , String format , String expr ) { String ret = str ; String [ ] params = null ; if ( format . length ( ) > 0 ) { ret = "" ; if ( expr . length ( ) > 0 ) // Indicates a format using regex { Pattern pattern = getPattern ( expr ) ; Matcher m = pattern . matcher ( str ) ; if ( m . find ( ) ) { params = new String [ m . groupCount ( ) ] ; for ( int i = 0 ; i < m . groupCount ( ) ; i ++ ) params [ i ] = m . group ( i + 1 ) ; } } else if ( str != null ) { params = new String [ ] { str } ; } if ( params != null ) ret = String . format ( format , params ) ; } return ret ; }
Converts the given string value to the output string format .