Here you can find the source of unquoteImpl(String s, char delim)
private static String unquoteImpl(String s, char delim)
//package com.java2s; /******************************************************************************* * Copyright (c) 2012 Firestar Software, Inc. * 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 * * Contributors://from www . ja v a 2 s . c o m * Firestar Software, Inc. - initial API and implementation * * Author: * Gabriel Oancea * *******************************************************************************/ public class Main { private static String unquoteImpl(String s, char delim) { if (s == null || s.length() < 2) return s; if (!(s.charAt(0) == delim && s.charAt(s.length() - 1) == delim)) return s; if (s.length() == 2) return ""; s = s.substring(1, s.length() - 1); StringBuffer sb = new StringBuffer(s.length()); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (c == delim) { if (i + 1 < s.length()) { char d = s.charAt(i + 1); if (d == delim) i++; } } sb.append(c); } return sb.toString(); } }