/** * <p> * Unescapes the escaped entities in the <code>String</code> passed and writes the result to the * <code>StringBuilder</code> passed. * </p> * * @param sb * The <code>StringBuilder</code> to write the results to; assumed to be non-null. * @param str * The source <code>String</code> to unescape; assumed to be non-null. * * @see #escape(String) * @see java.lang.StringBuilder */ public void unescape(StringBuilder sb, String str) { int firstAmp = str.indexOf('&'); if (firstAmp < 0) { sb.append(str); } else { doUnescape(sb, str, firstAmp); } }
/** * <p> * Unescapes the entities in a <code>String</code>. * </p> * * <p> * For example, if you have called addEntity("foo", 0xA1), unescape("&foo;") will return * "\u00A1" * </p> * * @param str * The <code>String</code> to escape. * @return A new escaped <code>String</code>. */ public String unescape(String str) { int firstAmp = str.indexOf('&'); if (firstAmp < 0) { return str; } else { StringBuilder sb = createStringBuilder(str); doUnescape(sb, str, firstAmp); return sb.toString(); } }
/** * <p> * Unescapes the escaped entities in the <code>String</code> passed and writes the result to the * <code>StringBuilder</code> passed. * </p> * * @param sb * The <code>StringBuilder</code> to write the results to; assumed to be non-null. * @param str * The source <code>String</code> to unescape; assumed to be non-null. * * @see #escape(String) * @see java.lang.StringBuilder */ public void unescape(StringBuilder sb, String str) { int firstAmp = str.indexOf('&'); if (firstAmp < 0) { sb.append(str); } else { doUnescape(sb, str, firstAmp); } }
/** * <p> * Unescapes the escaped entities in the <code>String</code> passed and writes the result to the * <code>StringBuilder</code> passed. * </p> * * @param sb * The <code>StringBuilder</code> to write the results to; assumed to be non-null. * @param str * The source <code>String</code> to unescape; assumed to be non-null. * * @see #escape(String) * @see java.lang.StringBuilder */ public void unescape(StringBuilder sb, String str) { int firstAmp = str.indexOf('&'); if (firstAmp < 0) { sb.append(str); } else { doUnescape(sb, str, firstAmp); } }
/** * <p> * Unescapes the entities in a <code>String</code>. * </p> * * <p> * For example, if you have called addEntity("foo", 0xA1), unescape("&foo;") will return * "\u00A1" * </p> * * @param str * The <code>String</code> to escape. * @return A new escaped <code>String</code>. */ public String unescape(String str) { int firstAmp = str.indexOf('&'); if (firstAmp < 0) { return str; } else { StringBuilder sb = createStringBuilder(str); doUnescape(sb, str, firstAmp); return sb.toString(); } }
/** * <p> * Unescapes the entities in a <code>String</code>. * </p> * * <p> * For example, if you have called addEntity("foo", 0xA1), unescape("&foo;") will return * "\u00A1" * </p> * * @param str * The <code>String</code> to escape. * @return A new escaped <code>String</code>. */ public String unescape(String str) { int firstAmp = str.indexOf('&'); if (firstAmp < 0) { return str; } else { StringBuilder sb = createStringBuilder(str); doUnescape(sb, str, firstAmp); return sb.toString(); } }