Java String Quote quoteString(String in)

Here you can find the source of quoteString(String in)

Description

Simple function to wrap quotes around a valid string.

License

Open Source License

Parameter

Parameter Description
in string to be quoted.

Return

quoted string (if input is not null).

Declaration

public static String quoteString(String in) 

Method Source Code

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

public class Main {
    /**//from w  ww .j  ava2  s. c  o m
     * Simple function to wrap quotes around a valid string.
     * 
     * @param in string to be quoted.
     * @return quoted string (if input is not null).
     */
    public static String quoteString(String in) {
        String ret = null; // assume failure

        if (in != null) {
            final String QUOTE = "\"";

            ret = QUOTE + in + QUOTE;
        }

        return ret;
    }
}

Related

  1. quoteString(final String str)
  2. quoteString(final String string)
  3. quoteString(final String text)
  4. quoteString(String arg)
  5. quoteString(String aTarget, String aPrefix, String aSuffix)
  6. quoteString(String quoted, String quoteFlag)
  7. quoteString(String s)
  8. quoteString(String s)
  9. quoteString(String s)