java正則表達式統計指定內容的漢字個數

String str = "ini的博客艾妮";  
System.out.println(str.length()-str.replaceAll("[\u4e00-\u9fa5]", "").length());
相關文章
相關標籤/搜索