List of utility methods to do String Quote
String | quoteArgument(String arg) Quotes specified string using '\"' if needed to. int length = arg.length(); boolean needQuotes; if (length == 0) { needQuotes = true; } else { switch (arg.charAt(0)) { case '\"': case '\'': ... |
String | quoteAtom(String term) Wraps an atom with single quotes and escapes all single quotes contained in the atom. return "'" + term.replace("'", "\\'") + "'"; |
String | quoteAtom(String term) quote Atom return "'" + term.replace("'", "\\'") + "'"; |
String | quoteAttrValue(String s) Perform entity-quoting of quotes within attribute values. return "\"" + s.replaceAll("&", "&").replaceAll("\"", """).replaceAll("\'", "'") + "\""; |
String | quoteCanonical(String s) Minimal escape form. if (s == null || s.length() == 0) { return "\"\""; int len = s.length(); StringBuilder sb = new StringBuilder(len + 4); sb.append('"'); for (int i = 0; i < len; i += 1) { char c = s.charAt(i); ... |
String | quoteCeylonKeywords(String qualifiedName) Returns a copy of the given qualified name, but with any keyword components in the name #quoteIfCeylonKeyword(String) quoted if necessary if (needsCeylonKeywordsQuoting(qualifiedName)) return join(".", quoteCeylonKeywords(qualifiedName.split("\\."))); else return qualifiedName; |
String | quoteCharacterData(char[] ch, int start, int length) Replace critical characters by XML entities. StringBuilder sb = new StringBuilder(); for (int i = start; i < start + length; i++) { char c; switch (c = ch[i]) { case '<': sb.append("<"); break; case '>': ... |
String | quoteCharacterData(String s) Quotes character data. final char space = '\u0020'; if (s == null) return null; s = replaceAll("&", "&", s); s = replaceAll("<", "<", s); s = replaceAll("\\", "\\\\", s); s = replaceAll("\r", "\\r", s); s = replaceAll("\n", "\\n", s); ... |
String | quoteCharacters(String s) quote Characters StringBuilder result = null; for (int i = 0, max = s.length(), delta = 0; i < max; i++) { char c = s.charAt(i); String replacement = null; if (c == '&') { replacement = "&"; } else if (c == '<') { replacement = "<"; ... |
String | quoteCharCode(int code) quote Char Code switch (code) { case '&': return "&"; case '<': return "<"; case '>': return ">"; default: ... |