Java String Unescape unescape(String str)

Here you can find the source of unescape(String str)

Description

unescape

License

Open Source License

Declaration

public static String unescape(String str) 

Method Source Code

//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();
    }
}

Related

  1. unescape(String str)
  2. unescape(String str)
  3. unescape(String str)
  4. unescape(String str)
  5. unescape(String str)
  6. unescape(String str)
  7. unescape(String str)
  8. unescape(String str)
  9. unescape(String str)