private static String unquote ( String s ) { if ( s . indexOf ( ' ' ) < 0 ) { return s ; } boolean isPrevQuote = false ; boolean inQuote = false ; StringBuilder buf = new StringBuilder ( ) ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( c == ' ' ) { if ( isPrevQuote ) { buf . append ( c ) ; isPrevQuote = false ; } else { isPrevQuote = true ; } inQuote = ! inQuote ; } else { isPrevQuote = false ; buf . append ( c ) ; } } return buf . toString ( ) ; }
Unquotes the message format style pattern .