String str="\uD83D\uDE01\uD83D\uDE01\uD83D\uDE01";//uD83DuDE01 是一个表情
it length=str.codePointCount(0,str.length());
for(it i=length; i>=0;i--){
int start =str.offsetByCodePoints(0,0);
int end =str.offsetByCodePoints(0,i);
System.out.println("substr"+str.substring(start,end);
}
网友评论