Here you can find the source of emptyStringToNull(String input)
public static String emptyStringToNull(String input)
//package com.java2s; //License from project: Open Source License public class Main { public static String emptyStringToNull(String input) { if (input.trim().equals("")) { return null; } else {/*w ww . j av a2s .c o m*/ return input.trim(); } } }