List of utility methods to do String Quote
String | quoteMonetDbValue(String value) Put escaped quotes around a value. return "'" + value.replaceAll("\\\\", "\\\\\\\\").replaceAll("'", "\\\\'") + "'"; |
String | quoteNameIfNecessary(String name) quote Name If Necessary return (name != null && name.indexOf(' ') >= 0 ? '"' + name + '"' : name); |
String | quoteNcName(String ncName) Quote name to make it NcName. String result = null;
return result;
|
String | quotEncode(String txt) quot Encode if ((txt == null) || (txt.length() == 0)) { return txt; txt = replace(txt, "&", "&"); txt = replace(txt, "\"", """); return txt; |
String | quotEncode(String txt) quot Encode if ((txt == null) || (txt.length() == 0)) { return txt; txt = replaceEx(txt, "&", "&"); txt = replaceEx(txt, "\"", """); return txt; |
String | quoteOutputName(String name) Returns a quoted name for StageOutput . StringBuilder buf = new StringBuilder(); for (char c : name.toCharArray()) { if ('1' <= c && c <= '9' || 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z') { buf.append(c); } else if (c <= 0xff) { buf.append('0'); buf.append(String.format("%02x", (int) c)); } else { ... |
String | quoteParameter(String param) quote Parameter if (IS_WINDOWS) { return "\"" + param + "\""; return param; |
String | quotePath(String path) quote Path if (path != null && path.indexOf(' ') != -1) { path = path.replaceAll("\\\\", "\\\\\\\\"); path = '"' + path + '"'; return path; |
String | quotePattern(String pattern) Quotes a string pattern as non-regular expression string. final String START = "\\Q"; final String STOP = "\\E"; final int STOP_LENGTH = 2; int stopIndex = pattern.indexOf(STOP); if (stopIndex < 0) { return START + pattern + STOP; String result = START; ... |
String | quotePattern(String s) Quotes a pattern. s = s.replaceAll("\\\\", "\\\\"); s = s.replaceAll("\\.", "\\\\."); s = s.replaceAll("\\+", "\\\\+"); s = s.replaceAll("\\{", "\\\\{"); s = s.replaceAll("\\}", "\\\\}"); s = s.replaceAll("\\|", "\\\\||"); s = s.replaceAll("[$]", "\\\\\\$"); s = s.replaceAll("\\?", "\\\\?"); ... |