Here you can find the source of quote(final String str)
Parameter | Description |
---|---|
str | a parameter |
public static final String quote(final String str)
//package com.java2s; public class Main { public static final String STR_EMP = ""; /**/*www . ja va2 s. c o m*/ * * @param str * @return */ public static final String quote(final String str) { return (str == null || str.length() == 0 || (str.charAt(0) == '`' && str.charAt(str.length() - 1) == '`')) ? str : new StringBuilder(str.length() + 2).append('`').append(str).append('`').toString(); } /** * * @param objs * @return */ public static String toString(final Object[] objs) { if (objs == null) { return STR_EMP; } final int len = objs.length; if (len == 0) { return STR_EMP; } final StringBuilder buf = new StringBuilder(len * 12); for (int i = 0; i < len - 1; i++) { buf.append(objs[i]).append(", "); } return buf.append(objs[len - 1]).toString(); } }