Java String Value Of valueOf(String str)

Here you can find the source of valueOf(String str)

Description

return "" if value is null otherwise return same string

License

LGPL

Parameter

Parameter Description
str a parameter

Return

string (not null)

Declaration

public static String valueOf(String str) 

Method Source Code

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

public class Main {
    /**//from w ww  . j av a2s.  co  m
     * return "" if value is null otherwise return same string
     * @param str
     * @return string (not null)
     */
    public static String valueOf(String str) {
        if (str == null)
            return "";
        return str;
    }
}

Related

  1. valueOf(String s)
  2. valueOf(String s)
  3. valueOf(String s)
  4. valueOf(String s, Class e)
  5. valueOf(String s, int def)
  6. valueOf(String str)
  7. valueOf(String stringVal, boolean dVal)
  8. valueOf(String value)
  9. valueOf(String value)