All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ext.test4j.apache.commons.lang.StringEscapeUtils Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
package ext.test4j.apache.commons.lang;

import ext.test4j.apache.commons.lang.Entities;

public class StringEscapeUtils {
	/**
	 * 

* Escapes the characters in a String using XML entities. *

* *

* For example: "bread" & "butter" => * "bread" & "butter". *

* *

* Supports only the five basic XML entities (gt, lt, quot, amp, apos). Does * not support DTDs or external entities. *

* *

* Note that unicode characters greater than 0x7f are currently escaped to * their numerical \\u equivalent. This may change in future releases. *

* * @param str * the String to escape, may be null * @return a new escaped String, null if null * string input * @see #unescapeXml(java.lang.String) */ public static String escapeXml(String str) { if (str == null) { return null; } return Entities.XML.escape(str); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy