首页 > 代码库 > String 字符串递归截取字节字符串

String 字符串递归截取字节字符串

 

public static String idgui(String s,int num)throws Exception{
int changdu = s.getBytes("UTF-8").length;
if(changdu > num){
s = s.substring(0, s.length() - 1);
s = idgui(s,num);
}
return s;
}

String 字符串递归截取字节字符串