@Test public void testBackslashEscapeCDMString() { assertThat(EscapeStrings.backslashEscapeCDMString("", "stuff")).isEqualTo(""); assertThat(EscapeStrings.backslashEscapeCDMString("any", "")).isEqualTo("any"); assertThat(EscapeStrings.backslashEscapeCDMString("any", "n")).isEqualTo("a\\ny"); }
public static String backslashEscapeCDMString(String s, String toescape) { if (toescape == null || toescape.isEmpty()) { return s; } if (s == null || s.isEmpty()) { return s; } StringBuilder buf = new StringBuilder(); for (int i = 0; i < s.length(); i++) { int c = s.charAt(i); if (toescape.indexOf(c) >= 0) { buf.append('\\'); } buf.append((char) c); } return buf.toString(); }
EscapeStrings { public static String backslashEscapeCDMString(String s, String toescape) { if (toescape == null || toescape.isEmpty()) { return s; } if (s == null || s.isEmpty()) { return s; } StringBuilder buf = new StringBuilder(); for (int i = 0; i < s.length(); i++) { int c = s.charAt(i); if (toescape.indexOf(c) >= 0) { buf.append('\\'); } buf.append((char) c); } return buf.toString(); } }
EscapeStrings { public static String backslashEscapeCDMString(String s, String toescape) { if (toescape == null || toescape.isEmpty()) { return s; } if (s == null || s.isEmpty()) { return s; } StringBuilder buf = new StringBuilder(); for (int i = 0; i < s.length(); i++) { int c = s.charAt(i); if (toescape.indexOf(c) >= 0) { buf.append('\\'); } buf.append((char) c); } return buf.toString(); }  }
EscapeStrings { public static String backslashEscapeCDMString(String s, String toescape) { if (toescape == null || toescape.isEmpty()) { return s; } if (s == null || s.isEmpty()) { return s; } StringBuilder buf = new StringBuilder(); for (int i = 0; i < s.length(); i++) { int c = s.charAt(i); if (toescape.indexOf(c) >= 0) { buf.append('\\'); } buf.append((char) c); } return buf.toString(); }  static String backslashEscape(String x, String reservedChars); static String backslashUnescape(String x); static List<String> tokenizeEscapedName(String escapedName); static String backslashEscapeCDMString(String s, String toescape); static int indexOf(String escapedName, char c); @Nullable static String escapeOGC(String s); @Nullable static String escapeURLQuery(String ce); @Nullable static String escapeString(String in, String allowable); @Nullable static String unescapeURLQuery(String ce); @Nullable static String unescapeString(String in); @Nullable static String urlDecode(String s); }
EscapeStrings { public static String backslashEscapeCDMString(String s, String toescape) { if (toescape == null || toescape.isEmpty()) { return s; } if (s == null || s.isEmpty()) { return s; } StringBuilder buf = new StringBuilder(); for (int i = 0; i < s.length(); i++) { int c = s.charAt(i); if (toescape.indexOf(c) >= 0) { buf.append('\\'); } buf.append((char) c); } return buf.toString(); }  static String backslashEscape(String x, String reservedChars); static String backslashUnescape(String x); static List<String> tokenizeEscapedName(String escapedName); static String backslashEscapeCDMString(String s, String toescape); static int indexOf(String escapedName, char c); @Nullable static String escapeOGC(String s); @Nullable static String escapeURLQuery(String ce); @Nullable static String escapeString(String in, String allowable); @Nullable static String unescapeURLQuery(String ce); @Nullable static String unescapeString(String in); @Nullable static String urlDecode(String s);  }