//正则表达式去掉中文
public static void regexDelChinese(){
String str = "a67$bcdefg中文dcba111";
Pattern p=Pattern.compile("[\\u4e00-\\u9fa5]");
StringBuffer bf = new StringBuffer();
for(int i=0; i<str.length(); i++){
String s = str.substring(i,i+1);
Matcher m = p.matcher(s);
if(m.find()){
System.out.println( "----"+s);
}else{
System.out.println( "- "+s);
bf.append(s);
}
}
System.out.println( "-------------"+bf.toString());
}
//文件移动
public static boolean move(String srcFile, String destPath){
File file = new File(srcFile);
File dir = new File(destPath);
boolean success = file.renameTo(new File(dir, file.getName()));//移动
file.delete();//删除
return success;
}