Java String Quote quote(String str)

Here you can find the source of quote(String str)

Description

Quotes a String.

License

Apache License

Parameter

Parameter Description
str the String to be quoted.

Return

quoted version

Declaration

private static String quote(String str) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*from   ww w . j  a  v a  2s. com*/
     * Quotes a String.
     * 
     * @param str  the String to be quoted.
     * 
     * @return quoted version
     */
    private static String quote(String str) {
        //maybe should use the escape class also?
        StringBuffer sb = new StringBuffer();
        sb.append("\"").append(str).append("\"");
        return sb.toString();
    }
}

Related

  1. quote(String str)
  2. quote(String str)
  3. quote(String str)
  4. quote(String str)
  5. quote(String str)
  6. quote(String str)
  7. quote(String str)
  8. quote(String str)
  9. quote(String str, char c)