Here you can find the source of unQuote(final String quoted)
public static String unQuote(final String quoted)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * and Eclipse Distribution License v1.0 which accompany this distribution. * The Eclipse Public License is available at * http://www.eclipse.org/legal/epl-v10.html * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors:/*w w w. java2 s. com*/ * Jan S. Rellermeyer, IBM Research - initial API and implementation *******************************************************************************/ public class Main { public static String unQuote(final String quoted) { final String quoted1 = quoted.trim(); final int len = quoted1.length(); final int start = quoted1.charAt(0) == '"' ? 1 : 0; final int end = quoted1.charAt(quoted1.length() - 1) == '"' ? len - 1 : len; return start == 0 && end == len ? quoted : quoted1.substring(start, end); } }