@Test public void escapeIdentifier() { assertEquals("\"a\"", Strings.escapeIdentifier("a")); assertEquals("\"A\"", Strings.escapeIdentifier("A")); assertEquals("\"a.b\"", Strings.escapeIdentifier("a.b")); assertEquals("\"a\"\"b\"", Strings.escapeIdentifier("a\"b")); }
public static String escapeIdentifier(String s) { return String.format("\"%s\"", s.replace("\"", "\"\"")); }
Strings { public static String escapeIdentifier(String s) { return String.format("\"%s\"", s.replace("\"", "\"\"")); } }
Strings { public static String escapeIdentifier(String s) { return String.format("\"%s\"", s.replace("\"", "\"\"")); }  }
Strings { public static String escapeIdentifier(String s) { return String.format("\"%s\"", s.replace("\"", "\"\"")); }  static List<String> entriesToString(Map<?, ?> map); static String nl(); static String join(Collection<?> strings); static String join(Object... strings); static String join(Collection<?> strings, String delimiter); static String repeatString(String str, int count); static List<String> stringAndSort(Collection<?> inputs); static List<String> stringAndSort(Map<?,?> inputs); static List<String> dumpResource(Class<?> forClass, String path); static List<String> dumpURLs(Enumeration<URL> urls); @SuppressWarnings("unused") // primarily useful in debuggers static String[] dumpException(Throwable t); static String toOctal(byte[] bytes); static String hex(byte[] bytes); static String hex(ByteSource byteSource); static String hex(byte[] bytes, int start, int length); static ByteSource parseHexWithout0x(String st); static ByteSource parseHex(String string); static List<String> readStream(InputStream is); static void readStreamTo(InputStream is, Appendable out, boolean keepNL); static String toString(Multimap<T,?> map); static String stripr(String input, String suffix); static List<String> dumpFile(File file); static String dumpFileToString(File file); static List<String> mapToString(Collection<?> collection); static boolean equalCharsets(Charset one, String two); static String formatMD5(byte[] md5, boolean toLowerCase); static String truncateIfNecessary(String str, int codePointCount); static String toBase64(byte[] bytes); static String toBase64(byte[] bytes, int offset, int length); static byte[] fromBase64(CharSequence cs); static String[] parseQualifiedName(String arg, int maxParts); static String quotedIdent(String s, char quote, boolean force); static String escapeIdentifier(String s); }
Strings { public static String escapeIdentifier(String s) { return String.format("\"%s\"", s.replace("\"", "\"\"")); }  static List<String> entriesToString(Map<?, ?> map); static String nl(); static String join(Collection<?> strings); static String join(Object... strings); static String join(Collection<?> strings, String delimiter); static String repeatString(String str, int count); static List<String> stringAndSort(Collection<?> inputs); static List<String> stringAndSort(Map<?,?> inputs); static List<String> dumpResource(Class<?> forClass, String path); static List<String> dumpURLs(Enumeration<URL> urls); @SuppressWarnings("unused") // primarily useful in debuggers static String[] dumpException(Throwable t); static String toOctal(byte[] bytes); static String hex(byte[] bytes); static String hex(ByteSource byteSource); static String hex(byte[] bytes, int start, int length); static ByteSource parseHexWithout0x(String st); static ByteSource parseHex(String string); static List<String> readStream(InputStream is); static void readStreamTo(InputStream is, Appendable out, boolean keepNL); static String toString(Multimap<T,?> map); static String stripr(String input, String suffix); static List<String> dumpFile(File file); static String dumpFileToString(File file); static List<String> mapToString(Collection<?> collection); static boolean equalCharsets(Charset one, String two); static String formatMD5(byte[] md5, boolean toLowerCase); static String truncateIfNecessary(String str, int codePointCount); static String toBase64(byte[] bytes); static String toBase64(byte[] bytes, int offset, int length); static byte[] fromBase64(CharSequence cs); static String[] parseQualifiedName(String arg, int maxParts); static String quotedIdent(String s, char quote, boolean force); static String escapeIdentifier(String s); static final String NL; }