java字符串去中文正则方法

//去中文字符的正则
	public String  test(String str){
		Pattern pat = Pattern.compile("[\u4e00-\u9fa5]");  
		Matcher mat=pat.matcher(str); 
		String result = mat.replaceAll("");
		return  result;
	}

猜你喜欢

转载自blog.csdn.net/qq_33271461/article/details/89456747
今日推荐