Java Null Value Convert convertNullToEmptyString(String s)

Here you can find the source of convertNullToEmptyString(String s)

Description

Returns the empty string if s is null; otherwise, returns s.

License

Open Source License

Declaration

public static String convertNullToEmptyString(String s) 

Method Source Code

//package com.java2s;

public class Main {
    /** Returns the empty string if <code>s</code> is null; otherwise, returns <code>s</code>. */
    public static String convertNullToEmptyString(String s) {
        return (s == null) ? "" : s;
    }/* ww w  . j av  a2 s  .c  o m*/
}

Related

  1. convertNullableString(Object object)
  2. convertNullString2Empty(Object str)
  3. convertNullToBlank(String s)
  4. convertNullToEmptyStr(String inObj)
  5. convertNullToEmptyString(Object raw)
  6. convertNullToEmptyString(String value)
  7. convertNullToFalse(Boolean b)
  8. convertNullToInteger(Object orgStr, int convertStr)
  9. convertNullToLong(Object orgStr, Long convertStr)