private static String cleanString ( String s ) { if ( s != null ) { s = s . trim ( ) ; if ( s . equals ( "" ) ) { s = null ; } } return s ; }
Remove space at both ends and convert empty strings to null .