offsetByCodePoints
public int offsetByCodePoints(int index , int codePointOffset)
返回此 String 中从给定的 index 处偏移 codePointOffset 个代码点的索引。
如果没有辅助字符的话,这个方法很没有意思
如果有辅助字符的话,就有作用了
String str="hello";
int n=str.offsetByCodePoints(0,3);
System.out.println(n);
run:
3