public static String quoteEscape ( final String original ) { String result = original ; if ( result . indexOf ( ' ' ) >= 0 ) { result = result . replace ( "\"" , ESCAPED_QUOTE ) ; } if ( result . indexOf ( COMMA ) >= 0 ) { result = "\"" + result + "\"" ; } return result ; }
Quote and escape input value for CSV