Here you can find the source of quote(String str, char c)
public static String quote(String str, char c)
//package com.java2s; /**//from ww w.j a v a 2 s . co m SpagoBI, the Open Source Business Intelligence suite Copyright (C) 2012 Engineering Ingegneria Informatica S.p.A. - SpagoBI Competency Center This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. **/ public class Main { /** * Inserts a given character at the beginning and at the end of the specified string. * For example if the string is <tt>extreme</tt> and the char is <tt>'</tt> then * the returned string is <tt>'exterme'</tt>. */ public static String quote(String str, char c) { assert (str != null); StringBuffer buffer = new StringBuffer(str.length() + 2); buffer.append(c); buffer.append(str); buffer.append(c); return buffer.toString(); } }