Here you can find the source of quote(final CharSequence original)
public static CharSequence quote(final CharSequence original)
//package com.java2s; //License from project: Open Source License public class Main { public static CharSequence quote(final CharSequence original) { final StringBuilder buff = builder().append('"'); final int len = original.length(); for (int i = 0; i < len; i++) { final char c = original.charAt(i); if (c == '"' || c == '#') { buff.append('#'); }/*from w ww. ja va 2 s . com*/ buff.append(c); } buff.append('"'); buff.trimToSize(); return buff; } public static StringBuilder builder() { return new StringBuilder(); } }