Java String Empty to Null emptyToNull(String field)

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

Description

empty To Null

License

Apache License

Declaration

private static String emptyToNull(String field) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private static String emptyToNull(String field) {
        return "".equals(field) ? null : field;
    }//from   w ww  .j a v  a  2  s .c o m
}

Related

  1. emptyStringToNull(String str)
  2. emptyStringToNull(String string)
  3. emptyToDefault(String value, String def)
  4. emptyToDefault(T[] values, T[] def)
  5. emptyToNull(final String text, final boolean doTrim)
  6. emptyToNull(String s)
  7. emptyToNull(String s)
  8. emptyToNull(String str)
  9. emptyToNull(String str)