java替换指定字符串的指定区间内字符为"*"
1、在项目中引入hutool的jar包

2、首先定义一个String类型的字符串

3、startInclude 开始位置(包含)
endExclude 结束位置(不包含)

4、String s = StrUtil.hide(str1,startInclude,endExclude);//替换指定字符串的指定区间内字符为"*"

5、运行程序后查看被隐藏后为结果

阅读量:48
阅读量:181
阅读量:86
阅读量:73
阅读量:126
1、在项目中引入hutool的jar包

2、首先定义一个String类型的字符串

3、startInclude 开始位置(包含)
endExclude 结束位置(不包含)

4、String s = StrUtil.hide(str1,startInclude,endExclude);//替换指定字符串的指定区间内字符为"*"

5、运行程序后查看被隐藏后为结果
