Java String Quote quoteWrap(String name)

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

Description

Wrap the name in double quotes

License

Open Source License

Parameter

Parameter Description
name name

Return

quoted name

Declaration

public static String quoteWrap(String name) 

Method Source Code

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

public class Main {
    /**//  w ww. j  a v a2s . com
     * Wrap the name in double quotes
     *
     * @param name
     *            name
     * @return quoted name
     */
    public static String quoteWrap(String name) {
        String quoteName = null;
        if (name != null) {
            quoteName = "\"" + name + "\"";
        }
        return quoteName;
    }

    /**
     * Wrap the names in double quotes
     *
     * @param names
     *            names
     * @return quoted names
     */
    public static String[] quoteWrap(String[] names) {
        String[] quoteNames = null;
        if (names != null) {
            quoteNames = new String[names.length];
            for (int i = 0; i < names.length; i++) {
                quoteNames[i] = quoteWrap(names[i]);
            }
        }
        return quoteNames;
    }
}

Related

  1. QuoteValue(String str)
  2. quoteValue(String value)
  3. QuoteValueIfNeeded(String str)
  4. quoteValues(String value)
  5. quoteWhitespaces(String path)