java 返回字符串中位置n的代码单元和位置n的代码点

来源:互联网 发布:小影怎么添加网络音乐 编辑:程序博客网 时间:2024/05/29 05:55
charAt char charAt(int index)Returns the char value at the specified index.
codePointAt int codePointAt(int index)Returns the character (Unicode code point) at the specified index. offsetByCodePoints
offsetByCodePointspublic int offsetByCodePoints(int index,                              int codePointOffset)返回此 String 中从给定的 index 处偏移 codePointOffset 个代码点的索引。文本范围内由 index 和 codePointOffset 给定的未配对代理项各计为一个代码点。参数:index - 要偏移的索引codePointOffset - 代码点中的偏移量返回:String 的索引
阅读全文
0 0
原创粉丝点击