public static String unescapeQuotedString(String string) {
        StringBuilder sb = new StringBuilder(string);
        for (int i = 0; i < sb.length(); i++) {
            if (sb.charAt(i) == '\\') {
                sb.deleteCharAt(i);
                if (i == sb.length()) {
                    throw new IllegalArgumentException("Parse error" + string);
                }
                switch (sb.charAt(i)) {
                    case 'n' -> sb.setCharAt(i, '\n');
                    case 'r' -> sb.setCharAt(i, '\r');
                    case 't' -> sb.setCharAt(i, '\t');
                    case 'f' -> sb.setCharAt(i, '\f');
                    case 'x' -> {
                        if (i + 2 >= sb.length()) {
                            throw new IllegalArgumentException("Could not parse hex value " + string);
                        }
                        sb.setCharAt(i, (char) Integer.parseInt(sb.substring(i + 1, i + 3), 16));
                        sb.delete(i + 1, i + 3);
                    }
                    case '\\' -> sb.setCharAt(i, '\\');
                }
            }
        }

        if (sb.length() > 0 && (sb.charAt(0) == '"') && sb.charAt(sb.length() - 1) == '"') {
            sb.deleteCharAt(sb.length() - 1);//remove last quote
            if (sb.length() > 0) {
                sb.deleteCharAt(0);  //remove first quote
            }
        }
        return sb.toString();
    }
@Test
    void testUnescapeQuotedString() {
        String a = "\"Hei\"";
        assertEquals("Hei", StringNode.unescapeQuotedString(a));
        assertEquals("foo\"bar\"", StringNode.unescapeQuotedString("foo\"bar\""));
        assertEquals("foo\"bar\"", StringNode.unescapeQuotedString("foo\\\"bar\\\""));
        assertEquals("a\rb\tc\fd", StringNode.unescapeQuotedString("a\\rb\\tc\\fd"));
        assertEquals("U", StringNode.unescapeQuotedString("\\x55"));
    }