Here you can find the source of unescape(String val)
private static String unescape(String val)
//package com.java2s; /*/* w ww. j a v a 2 s. co m*/ * Copyright (c) 2002-2017, the original author or authors. * * This software is distributable under the BSD license. See the terms of the * BSD license in the documentation provided with this software. * * http://www.opensource.org/licenses/bsd-license.php */ public class Main { private static final char ESCAPE_CHAR = '\\'; private static final String MARKER = "@__"; private static String unescape(String val) { val = val.replaceAll(MARKER, "@"); int escape = val.indexOf(ESCAPE_CHAR); while (escape >= 0 && escape < val.length() - 1) { char c = val.charAt(escape + 1); if (c == '{' || c == '}' || c == ESCAPE_CHAR) { val = val.substring(0, escape) + val.substring(escape + 1); } escape = val.indexOf(ESCAPE_CHAR, escape + 1); } return val; } }