Here you can find the source of unquote(char[] ca, int pos, StringBuffer out)
public static int unquote(char[] ca, int pos, StringBuffer out)
//package com.java2s; public class Main { /**/*from w w w .java 2 s. co m*/ * */ public static int unquote(char[] ca, int pos, StringBuffer out) { if (ca[pos++] != '"') { throw new IllegalArgumentException("Input not a quoted string"); } while (ca[pos] != '"') { char c = ca[pos++]; if (c == '\\') { switch (ca[pos++]) { case '"': c = '"'; break; case '\\': c = '\\'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; default: throw new IllegalArgumentException("Illegal escape char in quoted string: \\" + ca[pos - 1]); } } if (out != null) { out.append(c); } } return pos + 1; } }