Java String Quote quotedName(String name)

Here you can find the source of quotedName(String name)

Description

DOCUMENTME.

License

Open Source License

Parameter

Parameter Description
name DOCUMENTME

Return

DOCUMENTME

Declaration

public static String quotedName(String name) 

Method Source Code

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

public class Main {
    /**//from www  .  j  ava  2s.c  om
     * DOCUMENTME.
     * 
     * @param name DOCUMENTME
     * @return DOCUMENTME
     */
    public static String quotedName(String name) {
        if (name == null)
            return "<null>";
        if ((name.indexOf(' ') >= 0) || (name.indexOf('.') >= 0) || (name.indexOf('-') >= 0)) {
            return '"' + name + '"';
        } else {
            return name;
        }
    }
}

Related

  1. quoted(String value)
  2. quoted(String value, boolean addQuotes)
  3. quotedEscape(final String string)
  4. quotedIndexOf(String text, int start, int limit, String setOfChars)
  5. quotedJavaChar(char c, StringBuilder b)
  6. quotedName(String name)
  7. quotedName(String name)
  8. quotedOrNULL(String str)
  9. quotedString(String in, boolean backslashIsEscape)