Here you can find the source of convertNull(Object o)
public static String convertNull(Object o)
//package com.java2s; //License from project: Apache License public class Main { public static String convertNull(String strvalue) { try {//from w w w . ja v a 2 s. c o m if (strvalue.equals("null") || strvalue.length() == 0) { return ""; } else { return strvalue.trim(); } } catch (Exception e) { return ""; } } public static String[] convertNull(String[] aContent) { try { for (int i = 0; i < aContent.length; i++) { if (aContent[i].toLowerCase().compareTo("null") == 0) { aContent[i] = ""; } } return aContent; } catch (Exception e) { return null; } } public static String convertNull(Object o) { try { String strvalue = String.valueOf(o); if (strvalue.equals(null) || strvalue.equals("null") || strvalue.length() == 0) { return ""; } else { return strvalue.trim(); } } catch (Exception e) { return ""; } } }