Java String Quote quoteString(final String input)

Here you can find the source of quoteString(final String input)

Description

Surrounds a string with quotes.

License

Creative Commons License

Parameter

Parameter Description
input string to edit

Exception

Parameter Description
IllegalArgumentException if String is null

Return

a string surrounded with quotes

Declaration

public static String quoteString(final String input) 

Method Source Code

//package com.java2s;
//License from project: Creative Commons License 

public class Main {
    /**/* w  w  w .j  a v a2 s  . c o m*/
     * Surrounds a string with quotes.
     * @param input string to edit
     * @return a string surrounded with quotes
     * @throws IllegalArgumentException if String is null
     */
    public static String quoteString(final String input) {
        if (input == null)
            throw new IllegalArgumentException("String cannot be null!");
        return '"' + input + '"';
    }
}

Related

  1. quoteSqlIdentifier(String identifier)
  2. quoteSqlIdentifier(String name)
  3. quoteSQLString(String s)
  4. quoteStr(Object o)
  5. quoteStrictOccurrences(final String textToMarkup, final String filter)
  6. quoteString(final String str)
  7. quoteString(final String string)
  8. quoteString(final String text)
  9. quoteString(String arg)