Here you can find the source of dequote(String s)
public static String dequote(String s)
//package com.java2s; public class Main { public static String dequote(String s) { return dequote(s, new char[] { '"', '\'' }); }/*from w ww . j av a 2s .co m*/ public static String dequote(String s, char[] quoteChars) { String result = s; if (indexOfAnyOf(s, quoteChars) == 0) { final char leading = s.charAt(0); if (s.charAt(s.length() - 1) == leading) { result = s.substring(1, s.length() - 1); } } return result; } public static int indexOfAnyOf(String s, char[] chars) { return indexOfAnyOf(s, chars, 0); } public static int indexOfAnyOf(String s, char[] chars, int fromIndex) { int result = -1; for (int i = fromIndex; i < s.length() && result == -1; i++) { final int one = isOneOf(s.charAt(i), chars); if (-1 != one) { result = i; } } return result; } public static int isOneOf(char c, char[] set) { int result = -1; for (result = 0; result < set.length && c != set[result]; result++) { } return result >= set.length ? -1 : result; } }