Android XML String Escape encodeEntities(String content)

Here you can find the source of encodeEntities(String content)

Description

encode Entities

Declaration

public static String encodeEntities(String content) 

Method Source Code

//package com.java2s;

public class Main {
    public static String encodeEntities(String content) {
        content = content.replace("&", "&");
        content = content.replace("<", "&lt;");
        content = content.replace(">", "&gt;");
        content = content.replace("\"", "&quot;");
        content = content.replace("'", "&apos;");
        return content;
    }//w ww .jav  a  2  s .c  o m
}

Related

  1. xmlEscape(String xml)
  2. escape(String input)
  3. escapeText(String rawText)
  4. getXmlEncoded(String text)
  5. encodeEntities(String content)
  6. encodeXML(final String str)
  7. XmlEscape(String value)
  8. xmlEscape(String source)
  9. appendPlainText(StringBuilder dest, String src)