Here you can find the source of unescape(String s)
public static String unescape(String s)
//package com.java2s; //License from project: Open Source License public class Main { public static String unescape(String s) { String out = ""; boolean esc = false; for (char c : s.toCharArray()) { if (esc) { if (c == 'n') { out += '\n'; } else if (c == 't') { out += '\t'; } else { out += c;// w w w . j a va2 s . c o m } esc = false; } else { if (c == '\\') { esc = true; } else { out += c; } } } return out; } }