Here you can find the source of unescape(String str)
public static String unescape(String str)
//package com.java2s; //License from project: Open Source License public class Main { public static String unescape(String str) { StringBuilder sb = new StringBuilder(); boolean inEscape = false; for (int i = 0; i < str.length(); ++i) { if (inEscape) { inEscape = false;/*from ww w. j a va 2 s . c o m*/ sb.append(str.charAt(i)); } else { if (str.charAt(i) == '\\') { inEscape = true; } else { sb.append(str.charAt(i)); } } } return sb.toString(); } }