Java Utililty Methods Char Array to Entity

List of utility methods to do Char Array to Entity

  1. HOME
  2. Java
  3. C
  4. Char Array to Entity

Description

The list of methods to do Char Array to Entity are organized into topic(s).

Method

String charsToEntities(String str)
Converts <, >, & in the string to their HTML entity equivalents.
StringBuffer buf = new StringBuffer(str.length());
for (int i = 0; i < str.length(); i++) {
 char ch = str.charAt(i);
 switch (ch) {
 case '<':
 buf.append("<");
 break;
 case '>':
...
String charsToEntities(String str, boolean xml11)
Converts <, >, & in the string to their HTML entity equivalents.
StringBuilder buf = new StringBuilder(str.length());
for (int i = 0; i < str.length(); i++) {
 char ch = str.charAt(i);
 if (((0x00 <= ch && ch <= 0x1F) || (0x7F <= ch && ch <= 0x9F)) && ch != '\r' && ch != '\n'
 && ch != '\t') {
 if (xml11 && ch != 0x00) {
 buf.append("&#").append((int) ch).append(';');
 } else {
...

AltStyle によって変換されたページ (->オリジナル) /