Java String Quote quote(Object s)

Here you can find the source of quote(Object s)

Description

The quote() method simply adds double quotes around a string.

License

Open Source License

Parameter

Parameter Description
s the string to add double quotes to

Return

a new string that is the result of concatenating the double quote character, the specified string, and another double quote character in sequence

Declaration

public static String quote(Object s) 

Method Source Code

//package com.java2s;

public class Main {
    public static final String QUOTE = "\"";

    /**//from w w w.  j a  v  a 2 s. c o  m
     * The <code>quote()</code> method simply adds double quotes around a string.
     *
     * @param s the string to add double quotes to
     * @return a new string that is the result of concatenating the double quote character, the specified
     *         string, and another double quote character in sequence
     */
    public static String quote(Object s) {
        return QUOTE + s + QUOTE;
    }
}

Related

  1. quote(final String value)
  2. quote(final String value)
  3. quote(final String value)
  4. quote(Object aObject)
  5. quote(Object s)
  6. quote(Object value)
  7. quote(String content)
  8. quote(String content, String quoteMark)
  9. quote(String content, String quoteMark)