Java String Empty to Null emptyToNull(String string)

Here you can find the source of emptyToNull(String string)

Description

empty To Null

License

Open Source License

Declaration

public static String emptyToNull(String string) 

Method Source Code

//package com.java2s;

public class Main {
    public static String emptyToNull(String string) {
        return isNullOrEmpty(string) ? null : string;
    }/*from ww w  .ja v a2s .c o m*/

    public static boolean isNullOrEmpty(String string) {
        return string == null || string.isEmpty();
    }
}

Related

  1. emptyToNull(String s)
  2. emptyToNull(String s)
  3. emptyToNull(String str)
  4. emptyToNull(String str)
  5. emptyToNull(String str)
  6. emptyToNull(String text)
  7. emptyToNull(String val)
  8. emptyToNull(String value)
  9. emptyToString(String str, String returnStr)