List of utility methods to do String Quote
String | quote(String entityName) quote StringBuilder sb = new StringBuilder(); sb.append("'"); for (int i = 0; i < entityName.length(); i++) { char curChar = entityName.charAt(i); if (curChar == SINGLE_QUOTE || curChar == ESCAPE_CHAR) { sb.append(ESCAPE_CHAR); } else { sb.append(curChar); ... |
String | quote(String filepath) Enclose in quotes, used for paths and filenames that contains spaces return ("\"" + filepath + "\""); |
String | quote(String inp) Escapes special characters in a string StringBuffer sb = new StringBuffer(inp.length()); sb.append('\"'); sb.append(escape(inp)); sb.append('\"'); return sb.toString(); |
CharSequence | quote(String input) quote StringBuilder sb = new StringBuilder(""); sb.append('"'); for (char c : input.toCharArray()) { if (c == '\n') { sb.append("\\n"); continue; if (c == '"' || c == '\'' || c == '\\') { ... |
String | quote(String input) quote the given String using double quotes, replace all double quotes within the given String by doubleing them. return '"' + input.replaceAll("\"", "\"\"") + '"'; |
String | quote(String literal) Puts a quote before and after given string. String result = ""; boolean t_bProcessed = true; if ((literal != null) && (literal.length() > 0)) { if (literal.charAt(0) != '\"') { if (literal.charAt(0) != '\'') { result = "\"" + literal + "\""; } else { if (literal.trim().length() > 0) { ... |
String | quote(String message, String quotationMark) quote a given message with an quotation mark if (message == null) return message; return String.format("%s%s%s", quotationMark, message, quotationMark); |
String | quote(String name) Return a representation of the given name ensuring quoting (wrapped with '`' characters). if (name == null || name.length() == 0 || isQuoted(name)) { return name; } else { return new StringBuffer(name.length() + 2).append('`').append(name).append('`').toString(); |
String | quote(String name) Quote the given name by prefixing it with a dollar ($) return "$" + name; |
String | quote(String name) quote if (name.toLowerCase().indexOf("\\e") > 0) { throw new RuntimeException("Quote method will fail"); return "\\Q" + name + "\\E"; |