Here you can find the source of unquote(String entityName)
private static String unquote(String entityName)
//package com.java2s; public class Main { public static final char SINGLE_QUOTE = '\''; public static final char ESCAPE_CHAR = '\\'; private static String unquote(String entityName) { if (entityName.length() < 2) { return entityName; }/* ww w .j a v a 2 s.c om*/ if (!(entityName.charAt(0) == SINGLE_QUOTE && entityName.charAt(entityName.length() - 1) == SINGLE_QUOTE)) { return entityName; } if (entityName.indexOf('\'') == -1) { return entityName.substring(1, entityName.length() - 1); } else { StringBuilder sb = new StringBuilder(); for (int i = 1; i < entityName.length() - 1; i++) { char curChar = entityName.charAt(i); if (curChar != ESCAPE_CHAR) { sb.append(curChar); } else { if (i + 1 < entityName.length()) { sb.append(entityName.charAt(i + 1)); i = i + 1; } else { sb.append(ESCAPE_CHAR); } } } return sb.toString(); } } }