Here you can find the source of unquote(String quoted)
public static String unquote(String quoted)
//package com.java2s; /******************************************************************************* * Copyright (c) 2007, 2009 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. * /*from www. j a va2 s .c om*/ * Contributors: * Oracle - initial API and implementation ******************************************************************************/ public class Main { /** * Removes the first and last single or double quotes (if they exist). */ public static String unquote(String quoted) { if (quoted != null && quoted.length() >= 2) { int len = quoted.length(); char firstChar = quoted.charAt(0); char lastChar = quoted.charAt(len - 1); if (firstChar == lastChar && (firstChar == '\'' || firstChar == '"')) { return quoted.substring(1, len - 1); } } return quoted; } }