*@(#)StringUtil.java*@authorlianghpublicclassStringUtil{publicStringUtil(){}publicstaticvoidmain(String[]args){Stringstr=System.out.println(StringUtil.omitString(str,30));str=;System.out.println(StringUtil.omitString(str,30));str="12345英afa五左,大有枝节a";System.out.println(StringUtil.omitString(str,30));str="12345英afa五左,大有枝节基";System.out.println(StringUtil.omitString(str,30));}*计算字符串的字节长度(字母数字计1,汉字及标点计2)publicstaticintbyteLength(Stringstring){intcount=0;for(inti=0;i