add support charpoint

This commit is contained in:
looly 2021-12-29 07:52:07 +08:00
parent 78e30def67
commit 685925cd26
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@
### 🐣新特性 ### 🐣新特性
* 【db 】 优化Condition参数拆分pr#2046@Github * 【db 】 优化Condition参数拆分pr#2046@Github
* 【core 】 优化ArrayUtil.isAllEmpty性能pr#2045@Github * 【core 】 优化ArrayUtil.isAllEmpty性能pr#2045@Github
* 【core 】 CharSequenceUtil.replace方法支持增补字符pr#2041@Github
### 🐞Bug修复 ### 🐞Bug修复
* 【http 】 HttpUtil重定向次数失效问题issue#I4O28Q@Gitee * 【http 】 HttpUtil重定向次数失效问题issue#I4O28Q@Gitee

View File

@ -3570,7 +3570,8 @@ public class CharSequenceUtil {
} }
/** /**
* 替换指定字符串的指定区间内字符为固定字符 * 替换指定字符串的指定区间内字符为固定字符<br>
* 此方法使用{@link String#codePoints()}完成拆分替换
* *
* @param str 字符串 * @param str 字符串
* @param startInclude 开始位置包含 * @param startInclude 开始位置包含
@ -3583,7 +3584,7 @@ public class CharSequenceUtil {
if (isEmpty(str)) { if (isEmpty(str)) {
return str(str); return str(str);
} }
String originalStr = str(str); final String originalStr = str(str);
int[] strCodePoints = originalStr.codePoints().toArray(); int[] strCodePoints = originalStr.codePoints().toArray();
final int strLength = strCodePoints.length; final int strLength = strCodePoints.length;
if (startInclude > strLength) { if (startInclude > strLength) {