Java String Unescape unescape(String text)

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

Description

unescape

License

Open Source License

Declaration

public static String unescape(String text) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static final String[][] escapeMappings = { { "&", "&" },
            { ">", "&gt;" }, { "<", "&lt;" }, { "\"", "&quot;" },
            { "'", "&apos;" }, };

    public static String unescape(String text) {
        // must iterate in reverse order
        for (int i = escapeMappings.length - 1; i >= 0; i--) {
            text = text.replace(escapeMappings[i][1], escapeMappings[i][0]);
        }/* w w w .j  a v  a2 s.com*/
        return text;
    }
}

Related

  1. unescape(String string)
  2. unescape(String string)
  3. unescape(String string)
  4. unescape(String string)
  5. unescape(String string, int escape)
  6. unescape(String text)
  7. unescape(String text)
  8. unescape(String text)
  9. unescape(String text)