Android String Null Convert toStrNotNull(Object obj, String defaultStr)

Here you can find the source of toStrNotNull(Object obj, String defaultStr)

Description

to Str Not Null

Declaration

public static final String toStrNotNull(Object obj, String defaultStr) 

Method Source Code

//package com.java2s;

public class Main {

    public static final String toStrNotNull(Object obj, String defaultStr) {
        String s = (obj == null) ? defaultStr : obj.toString();
        return s;
    }/*from   www .j  a va 2s  .  c om*/
}

Related

  1. toNonNull(String str)
  2. convertToNull(String chaine)
  3. defaultIfNull(String str)
  4. defaultIfNull(String str, String defaultStr)
  5. defaultIfBlank(String str, String defaultStr)