StringUtil { static public String stripQuotes(String string0) { if (string0.length() == 0) { return string0; } if (string0.length() > 1 && string0.charAt(0) == '"' && string0.charAt(string0.length() - 1) == '"') { return string0.substring(1, string0.length() - 1); } else if (string0.charAt(0) == '"') { string0 = string0.substring(1); } else if (string0.charAt(string0.length() - 1) == '"') { string0 = string0.substring(0, string0.length() - 1); } return string0; }  static String substituteWithEnvironment(String string0); static String substituteWithProperties(String string0, String startStr, String endStr, Properties properties); static boolean isSafeString(String string0); static boolean isSafeChar(char ch); static String capitalize(String string0); static String uncapitalize(String string0); static boolean contains(String[] strings, String targetString); static int indexOf(String[] strings, String targetString); static String stripQuotes(String string0); static boolean containsOnlyDigits(String string0); static String[] split(String str, char delim); final static String formatForPrint(String input); static String[] toStringArray(Object[] objArray); static byte[] getAsciiBytes(String input); static String getAsciiString(byte[] input); static String trimTrailing(String str); static String truncate(String value, int length); static String slice(String value,
            int beginOffset, int endOffset,
            boolean trim); @Deprecated static String toHexString(byte[] bytes); @Deprecated static String toHexString(byte[] bytes, int offset, int length); @Deprecated static byte[] toHexByte(String hexString, int offset, int length); @Deprecated static byte[] fromHexString(String hexString); @Deprecated static byte[] fromHexString(String hexString, int offset, int length); static boolean isPrintableChar(char ch); static String hexDump(String prefix, byte[] data); static String SQLToUpperCase(String s); static boolean SQLEqualsIgnoreCase(String s1, String s2); static String normalizeSQLIdentifier(String id); static String compressQuotes(String source, String quotes); static String quoteStringLiteral(String string); static String stringify(int[] raw); static boolean isEmpty(String string0); static boolean isEqual(String string0, String string1); static String toStringWithNullAsEmpty(Object obj); static String toStringWithNullAsReplaced(Object obj); static String toStringWithNullAsNull(Object obj); static boolean isEqual(String string0, String string1, boolean caseSensitive); static String readToString(InputStream in); static String escapeXml(String value); static String removeAllCharsExceptDigits(String str0); static char[] HEX_TABLE; }
@Test public void stripQuotes() { String string0 = "\"10958\""; String string1 = "10958\""; String string2 = "\"10958"; String string3 = "10958"; String string4 = ""; Assert.assertEquals("10958", StringUtil.stripQuotes(string0)); Assert.assertEquals("10958", StringUtil.stripQuotes(string1)); Assert.assertEquals("10958", StringUtil.stripQuotes(string2)); Assert.assertEquals("10958", StringUtil.stripQuotes(string3)); Assert.assertEquals("", StringUtil.stripQuotes(string4)); String string5 = "\""; String string6 = "1\""; String string7 = "\"1"; String string8 = "1"; Assert.assertEquals("", StringUtil.stripQuotes(string5)); Assert.assertEquals("1", StringUtil.stripQuotes(string6)); Assert.assertEquals("1", StringUtil.stripQuotes(string7)); Assert.assertEquals("1", StringUtil.stripQuotes(string8)); }