Java HTML htmlCode(char tok)

Here you can find the source of htmlCode(char tok)

Description

html Code

License

Open Source License

Declaration

public static String htmlCode(char tok) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    private static final String[][] HTML = { { "<", "&lt;" }, { ">", "&gt;" }, { " ", "&nbsp;" },
            { "\n", "<br/>" } };

    public static String htmlCode(char tok) {
        int i = 0;
        for (; i < HTML.length; i++) {
            if (HTML[i][0].equals(tok + "")) {
                return HTML[i][1];
            }//ww w  . j  av a2s . co  m
        }
        return tok + "";
    }
}

Related

  1. htmlBlock(String labelText)
  2. htmlBold(String content)
  3. htmlButton(String value, String action, int width)
  4. HTMLcheck(String doc)
  5. htmlcodeToSpecialchars(String str)
  6. htmlcodeToSpecialchars(String str)
  7. htmlContentHeaderGen(String providerNo, String output, String errorMsg)
  8. htmlConvert(String htmlStr)