Map<String, Object> map = new HashMap();
map.put("1", "1");
map.put("2", "2");
map.put("3", "null");
map.put("4", null);
map.put("5", "5");
map.put("6", "");
map.put("7", "7");
System.out.println("替換前map===="+map);
for (Map.Entry<String, Object> entry : map.entrySet()) {
System.out.println("key= " + entry.getKey() + " and value= " + entry.getValue());
//String xx = entry.getValue()+"";
if("null".equals(entry.getValue())){
System.out.println(entry.getValue());
System.out.println((entry.getValue()+"").length());
entry.setValue(null);
}
}
System.out.println("map===="+map);