List of utility methods to do String Quote
String | quotePlainText(final String textContent) quote Plain Text return textContent.replaceAll("(?m)^", "> "); |
String | quoteQuery(String query) Return a quoted version of the query if the original query is not quoted final int length = query.length(); if (length > 1 && query.charAt(0) == '"' && query.charAt(length - 1) == '"') { return query; StringBuilder sb = new StringBuilder(); sb.append("\"").append(query).append("\""); return sb.toString(); |
String | quoteReference(final String reference) quote Reference if (reference == null) { throw new NullPointerException(); final char[] referenceChars = reference.toCharArray(); if (isQuotingNeeded(referenceChars) == false) { return '[' + reference + ']'; return '[' + quoteString(reference) + ']'; ... |
String | quoteRegexMeta(final String input) Encloses the input string into protective characters \Q und \E, thus disabling special meaning of regex meta chars like *, ?, ., etc. return "\\Q" + input + "\\E"; |
String | quoteRegexMeta(String str) Quote the characters in a String that have a special meaning in regular expression. if (str == null) return null; if (str.length() == 0) { return EMPTY_STRING; int len = str.length(); StringBuilder buf = new StringBuilder(len + 5); for (int i = 0; i < len; i++) { ... |
String | quoteRemarkSQL(String sql) In a string, replace block comment marks with /++ .. while (true) { int idx = sql.indexOf("*/"); if (idx < 0) { break; sql = sql.substring(0, idx) + "++/" + sql.substring(idx + 2); while (true) { ... |
String | quoteRemarkSQL(String sql) In a string, replace block comment marks with /++ .. sql = replaceAll(sql, "*/", "++/"); return replaceAll(sql, "/*", "/++"); |
String | quoteReplacement(String s) quote Replacement if ((s.indexOf('\\') == -1) && (s.indexOf('$') == -1)) return s; StringBuffer sb = new StringBuffer(); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == '\\') { sb.append('\\'); sb.append('\\'); ... |
String | quoteReplacement(String s) quote Replacement if (s.indexOf('\\') == -1 && s.indexOf('$') == -1) { return s; int length = s.length(); StringBuffer sb = new StringBuffer(length + 10); for (int i = 0; i < length; i++) { char c = s.charAt(i); if (c == '\\') { ... |
String | quotes(CharSequence stringToQuote) Quotes the given string (eg. return "'" + stringToQuote + "'"; |