Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java¹ýÂËÌØÊâ×Ö·û

public   static   String StringFilter(String   str)   throws  
PatternSyntaxException   {
          // Ö»ÔÊÐí×ÖĸºÍÊý×Ö       
          // String   regEx  =  "[^a-zA-Z0-9]";                     

             // Çå³ýµôËùÓÐÌØÊâ×Ö·û  
    String
regEx="[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~£¡@#£¤%……&*£¨£©——+|
{}¡¾¡¿‘£»£º”“’¡££¬¡¢£¿]";  
    Pattern   p   =   Pattern.compile(regEx);     
    Matcher   m   =   p.matcher(str);     
    return   m.replaceAll("").trim();     
    }

http://sunlianwei.javaeye.com/blog/363759


Ïà¹ØÎĵµ£º

JavaÏß³Ì֪ʶÉîÈë½âÎö(1)

Ò»°ãÀ´Ëµ,ÎÒÃǰÑÕýÔÚ¼ÆËã»úÖÐÖ´ÐеijÌÐò½Ð×ö"½ø³Ì"(Process) ,¶ø²»½«Æä³ÆÎª³ÌÐò(Program)¡£Ëùν"Ïß³Ì"(Thread),ÊÇ"½ø³Ì"ÖÐij¸öµ¥Ò»Ë³ÐòµÄ¿ØÖÆÁ÷¡£ÐÂÐ˵IJÙ×÷ϵͳ,ÈçMac,Windows NT,Windows 95µÈ,´ó¶à²ÉÓöàÏ̵߳ĸÅÄî,°ÑÏß ³ÌÊÓΪ»ù±¾Ö´Ðе¥Î»¡£Ïß³ÌÒ²ÊÇJavaÖеÄÏàµ±ÖØÒªµÄ×é³É²¿·ÖÖ®Ò»¡£
ÉõÖÁ×î¼òµ¥µÄAppletÒ²ÊÇÓɶà¸öÏß ......

java ËõÂÔͼ ʵÏÖ

import  java.awt.image. * ;
import  com.sun.image.codec.jpeg. * ;   
 public class poiReadDoc {
 Image img = null;
 int width = 0,height =0;
 String destFile = "";
 public void readImg(String fileName) throws IOException{
  File _fil ......

JAVAÖÐÈ¥µô¿Õ¸ñtrimº¯ÊýµÄ·½·¨

¡¡1. String.trim()
¡¡¡¡trim()ÊÇÈ¥µôÊ×β¿Õ¸ñ
¡¡¡¡2.str.replace(" ", ""); È¥µôËùÓпոñ£¬°üÀ¨Ê×β¡¢Öмä
¡¡String str = " hell o ";
¡¡¡¡String str2 = str.replaceAll(" ", "");
¡¡¡¡System.out.println(str2);
¡¡¡¡3.»òÕßreplaceAll(" +",""); È¥µôË ......

¹ØÓÚjavaµÄ++ºÍ

public class JavaPlus {

public static void main(String[] args) {
int x = 5;
x++;// x = x + 1;//ºó¼Ó¼Ó
System.out.println(x);
x--;// x = x - 1;//ºó¼õ¼õ
System.out.println(x);
++x;// x = x + 1;//ǰ¼Ó¼Ó
Sys ......

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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ