Java XML String Create toXMLString(String str)

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

Description

to XML String

License

Open Source License

Declaration

static String toXMLString(String str) 

Method Source Code

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

public class Main {
    static String toXMLString(String str) {
        return str.replaceAll("&", "&").replaceAll("\"", """)
                .replaceAll(">", "&gt;").replaceAll("<", "&lt;");
    }//from w  ww . ja  va  2s.  c  o  m
}

Related

  1. toXmlString(float value)
  2. toXMLString(String in)
  3. toXMLString(String javaString)
  4. toXMLString(String org)
  5. toXmlString(String s)
  6. toXMLString(String string)
  7. toXMLString(String t)
  8. toXMLString(String text)
  9. toXMLUnescapedText(final String text)