private String quoteFormatCharacters ( String literal ) { StringBuilder sb = new StringBuilder ( ) ; int length = literal . length ( ) ; char c ; for ( int loop = 0 ; loop < length ; loop ++ ) { c = literal . charAt ( loop ) ; switch ( c ) { case ' ' : case ' ' : case ' ' : case ' ' : case ' ' : case ' ' : case ' ' : case ' ' : { sb . append ( "'" ) ; sb . append ( c ) ; sb . append ( "'" ) ; break ; } default : { sb . append ( c ) ; break ; } } } return ( sb . toString ( ) ) ; }
This method is used to quote any special characters that appear in literal text that is required as part of the currency format .