易截截图软件、单文件、免安装、纯绿色、仅160KB

html特殊字符转换(java)

/**
* 把文本编码为Html代码
* @param target
* @return 编码后的字符串
*/
public static String htmEncode(String target)
{
StringBuffer stringbuffer = new StringBuffer();
int j = target.length();
for (int i = 0; i < j; i++)
{
char c = target.charAt(i);
switch (c)
{
case 60:
stringbuffer.append("<");
break;
case 62:
stringbuffer.append(">");
break;
case 38:
stringbuffer.append("&");
break;
case 34:
stringbuffer.append(""");
break;
case 169:
stringbuffer.append("©");
break;
case 174:
stringbuffer.append("®");
break;
case 165:
stringbuffer.append("¥");
break;
case 8364:
stringbuffer.append("€");
break;
case 8482:
stringbuffer.append("™");
break;
case 13:
if (i < j - 1 && target.charAt(i + 1) == 10)
{
stringbuffer.append("<br>");
i++;
}
break;
case 32:
if (i < j - 1 && target.charAt(i + 1) == ' ')
{
stringbuffer.append("  ");
i++;
break;
}
default:
stringbuffer.append(c);
break;
}
}
retur


相关文档:

html 表格特殊标题 (legend)

<html>
<head>
<mce:style type="text/css"><!--
td
{
width:50;
height:50;
text-align:center;
vertical-align: center;
}
table
{
vertical-align: bottom;
}
legend
{
text-align:center;
}
fieldset
{
width:300; ......

html 滚动条

<html>
<head>
<mce:style type = "text/css"><!--
div
{
overflow-y:scroll;
height:200;
overflow-x:scroll;
width:200;
}

--></mce:style><style type = "text/css" mce_bogus="1"> div
{
ove ......

Java 俄罗斯方块

import java.awt.*;
import java.awt.event.*;
//俄罗斯方块类
public class ERS_Block extends Frame{
 public static boolean isPlay=false;
 public static int level=1,score=0;
 public static TextField scoreField,levelField;
 
 public static MyTimer timer;
 Ga ......

java过滤特殊字符

public   static   String StringFilter(String   str)   throws  
PatternSyntaxException   {
          // 只允许字母和数字       
    &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号