Java String Unescape unescapeText(String s)

Here you can find the source of unescapeText(String s)

Description

unescape Text

License

Open Source License

Declaration

public static String unescapeText(String s) 

Method Source Code

//package com.java2s;

public class Main {
    public static String unescapeText(String s) {
        StringBuffer text = new StringBuffer(s);

        boolean more = true;
        while (more) {
            // if JDK 1.4, swap the following for a performance increase.
            //int i = text.indexOf( "\\\"" );   // 1.4 only
            int i = text.toString().indexOf("\\\""); // 1.3 only

            if (i != -1) {
                text.replace(i, i + 2, "\"");
            } else {
                more = false;// w  w w .  j a v a 2  s .c o  m
            }
        }

        //System.out.println( "unescapeText() Converted |"+s+"| to |"+text.toString()+"|" );

        return text.toString();
    }
}

Related

  1. unescapeString(String t)
  2. unescapeString(String text)
  3. unescapeString(String text)
  4. unescapeString(String text)
  5. unescapeString(String txt)
  6. unescapeText(String s)
  7. unescapeText(String s)
  8. unescapeText(String s)