Here you can find the source of emptyStringToNull(String str)
public static String emptyStringToNull(String str)
//package com.java2s; /*// w w w . ja va 2s . com * Dotcms minifier by ISAAC is licensed under a * Creative Commons Attribution 3.0 Unported License * * - http://creativecommons.org/licenses/by/3.0/ * - http://www.geekyplugins.com/ * * ISAAC Software Solutions B.V. (http://www.isaac.nl) */ public class Main { public static String emptyStringToNull(String str) { return str == null || str.equals("") ? null : str; } public static String emptyStringToNull(String str, String ifNullValue) { String ret = str == null || str.equals("") ? null : str; return ret == null ? ifNullValue : ret; } }