Here you can find the source of quote(String str)
Parameter | Description |
---|---|
str | the String to be quoted. |
private static String quote(String str)
//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(); } }