private static String trimCharEntity(String symbol){
  int start=0;
  int end=symbol.length();
  if (symbol.charAt(0) == '&') {
    start=1;
  }
  if (symbol.charAt(end - 1) == ';') {
    end--;
  }
  return symbol.substring(start,end);
}

private static String trimCharEntity ( String symbol ) { int start = 0 ; int end = symbol . length ( ) ; if ( symbol . charAt ( 0 ) == '&' ) { start = 1 ; } if ( symbol . charAt ( end - 1 ) == ';' ) { end -- ; } return symbol . substring ( start , end ) ; }
trims unneeded & and ; from the symbol if exist
