Java Null Value Convert null2Str(Object obj)

Here you can find the source of null2Str(Object obj)

Description

null Str

License

Open Source License

Declaration

public static String null2Str(Object obj) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static String null2Str(Object obj) {

        if ((obj == null) || (obj.equals("null")) || (obj.equals(""))) {
            return "";
        } else {/*from www  .j  av a  2s  .c  o m*/
            return obj.toString().trim();
        }
    }
}

Related

  1. null2emptyString(String value)
  2. null2Int(Object object, int def)
  3. null2Length0(String s)
  4. null2NA(String str)
  5. Null2Space(String str)
  6. null2Str(String str)
  7. null2String(Object obj)
  8. null2String(String str)
  9. null2String(String string)