Java String Empty emptyStringIfNull(String s)

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

Description

empty String If Null

License

Apache License

Declaration

public static String emptyStringIfNull(String s) 

Method Source Code

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

public class Main {
    public static String emptyStringIfNull(String s) {
        return (s == null || s.equals("")) ? "-" : s;
    }/*from  w  w  w  . j a  v a 2  s  .co  m*/
}

Related

  1. emptyString(String s)
  2. emptyString(String s)
  3. emptyString(String str)
  4. emptyString(String str)
  5. emptyString2Null(String stringValue)
  6. emptyStringIfNull(String string)
  7. emptyStrings()
  8. emptyStringToLongZero(String s)
  9. emptyStringToNull(String value)