List of utility methods to do String Quote
String | quote(String str) Quotes a String. StringBuffer sb = new StringBuffer(); sb.append("\"").append(str).append("\""); return sb.toString(); |
String | quote(String str) quote if (str == null) return str; if (str.length() < 2 || !str.startsWith("\"") || !str.endsWith("\"")) str = "\"" + str + "\""; return str; |
String | quote(String str) Returns a quoted string, surrounded with double quote return surround(str, "\""); |
String | quote(String str) Quote and escape a string for use in shell commands. return "\"" + str.replaceAll("\\\\", "\\\\\\\\").replaceAll("\"", "\\\\\"") + "\""; |
String | quote(String str, char c) Inserts a given character at the beginning and at the end of the specified string. assert (str != null); StringBuffer buffer = new StringBuffer(str.length() + 2); buffer.append(c); buffer.append(str); buffer.append(c); return buffer.toString(); |
String | quote(String str, String quoteChar) Quote the given String with passed quoteChar. return (str != null ? quoteChar + str + quoteChar : null);
|
StringBuffer | quote(String str, StringBuffer out) quote if (out == null) { out = new StringBuffer(); out.append('"'); int len = str.length(); for (int i = 0; i < len; i++) { char c = str.charAt(i); switch (c) { ... |
String | quote(String string) quote if (string == null || string.length() == 0) { return "\"\""; char c = 0; int i; int len = string.length(); StringBuilder sb = new StringBuilder(len + 4); String t; ... |
String | quote(String string) quote StringBuffer ret = new StringBuffer(string.length() + 2); ret.append('\"'); for (char character : string.toCharArray()) { switch (character) { case '"': ret.append('\\'); ret.append('"'); break; ... |
String | quote(String string) Given a string, wrap it in quotes (") if that string contains spaces if (string.indexOf(' ') != -1) string = "\"" + string + "\""; return string; |