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
Ïà¹ØÎĵµ£º
/*
Function name: myGetHttpFile2
Description: ÅÀÍøÒ³ÓÃ
Input: URL ÀýÈç:http://www.126.com
Output: ×Ö·û´®,ÍøÒ³µÄHTML
*/
public String myGetHttpFile2(String url){
String authentication=null;
ArrayList al=new ArrayList();
String PageURL = url;
......
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 ......
¡¡1. String.trim()
¡¡¡¡trim()ÊÇÈ¥µôÊ×β¿Õ¸ñ
¡¡¡¡2.str.replace(" ", ""); È¥µôËùÓпոñ£¬°üÀ¨Ê×β¡¢Öмä
¡¡String str = " hell o ";
¡¡¡¡String str2 = str.replaceAll(" ", "");
¡¡¡¡System.out.println(str2);
¡¡¡¡3.»òÕßreplaceAll(" +",""); È¥µôË ......
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 ......
public class InsertBlobData {
Connection con = null;
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
InsertBlobData data = new InsertBlobData();
data.insertBlogInfo("002jpg", "sdsdfdf", "2007-02-1 ......