public static String escapeSpecialCharacters ( String columnName , String escapeChars , String character ) { if ( Strings . isNullOrEmpty ( columnName ) ) { return null ; } if ( StringUtils . isEmpty ( escapeChars ) ) { return columnName ; } List < String > specialChars = Arrays . asList ( escapeChars . split ( "," ) ) ; for ( String specialChar : specialChars ) { columnName = columnName . replace ( specialChar , character ) ; } return columnName ; }
escape characters in column name or table name