Home > Contents > Index >
Expanded TOC   |    Accordion TOC   |    Annotated TOC   |    Index

 

Utilities.deBabble

Replaces the character encoding strings--%20 (space), %22 ("), %12 ( ), %3c (<), %3e (>), and %26 (&)--in an input string with the characters they represent.

Syntax

Parameters

str
String to convert.

Description

Certain reserved characters (such as <) can be encoded into their hexadecimal equivalents (for example, %3c). The deBabble method replaces these hexadecimal equivalents with the actual character name; for example, deBabble converts %3c back into the less-than sign (<). The deBabble method can convert the following hexadecimal values:

Hexadecimal String
deBabble Replacement
%20
space
%22
double quote (")
%25
percent (%)
%26
ampersand (&)
%0a
line feed ( )
%09
tab
%0d
carriage return ( )
%3c
less than (<)

 

Returns

Returns the converted string, or the same string if no conversion was done.

Example

The following fragment converts a string containing some embedded hexadecimal characters:

After executing the preceding code, the deBabbledStr object should contain the following:

 

  Home > Contents > Index >

Oracle JAVA Reference
Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.