public class Test11 {
public static void main(String[] args) throws Exception {
//统计汉字个数
String ss = "1432去fad阿萨德撒sgi";
byte[] b = ss.getBytes("GBK");
if(b.length>ss.length()) {
System.out.println("有汉字,个数为"+(b.length-ss.length()));
}
System.out.println("===================================");
//字符串中字符排序
char[] cc = ss.toCharArray();
System.out.println("排序前字符串:"+ss);
Arrays.sort(cc);
ss = new String(cc);
System.out.println("排序后字符串:"+ss);
}
}public class Test11 {
public static void main(