Java org.apache.commons.text StringEscapeUtils fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.text StringEscapeUtils fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.text StringEscapeUtils.

The text is from its open source code.

Field

CharSequenceTranslatorESCAPE_JSON
Translator object for escaping Json.

Method

StringescapeCsv(final String input)

Returns a String value for a CSV column enclosed in double quotes, if required.

If the value contains a comma, newline or double quote, then the String value is returned enclosed in double quotes.

Any double quote characters in the value are escaped with another double quote.

If the value does not contain a comma, newline or double quote, then the String value is returned unchanged.

see Wikipedia and RFC 4180.
StringescapeEcmaScript(final String input)

Escapes the characters in a String using EcmaScript String rules.

Escapes any values it finds into their EcmaScript String form.

StringescapeHtml3(final String input)

Escapes the characters in a String using HTML entities.

Supports only the HTML 3.0 entities.

StringescapeHtml4(final String input)

Escapes the characters in a String using HTML entities.

For example:

"bread" & "butter"

becomes:

"bread" & "butter".

StringescapeJava(final String input)

Escapes the characters in a String using Java String rules.

Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.)

So a tab becomes the characters '\\' and 't' .

The only difference between Java strings and JavaScript strings is that in JavaScript, a single quote and forward-slash (/) are escaped.

Example:

 input string: He didn't say, "Stop!" 
StringescapeJson(final String input)

Escapes the characters in a String using Json String rules.

Escapes any values it finds into their Json String form.

StringescapeXml10(final String input)

Escapes the characters in a String using XML entities.

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

StringescapeXml11(final String input)

Escapes the characters in a String using XML entities.

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

StringunescapeCsv(final String input)

Returns a String value for an unescaped CSV column.

StringunescapeEcmaScript(final String input)

Unescapes any EcmaScript literals found in the String .

For example, it will turn a sequence of '\' and 'n' into a newline character, unless the '\' is preceded by another '\' .

StringunescapeHtml4(final String input)

Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes.

StringunescapeJava(final String input)

Unescapes any Java literals found in the String .

StringunescapeJson(final String input)

Unescapes any Json literals found in the String .

For example, it will turn a sequence of '\' and 'n' into a newline character, unless the '\' is preceded by another '\' .

StringunescapeXml(final String input)

Unescapes a string containing XML entity escapes to a string containing the actual Unicode characters corresponding to the escapes.

Supports only the five basic XML entities (gt, lt, quot, amp, apos).