1、在你的项目中引入hutool的jar包
2、定义str 字符串和fromIndex 开始位置(包括)
3、searchStr 被查找的字符串rep盟敢势袂lacement 被替换的字符串ignoreCase 是否忽略大小写
4、String s = StrUtil.replace(str1,from诔罨租磊Index,searchStr,replacement,ignoreCase);//替换字符串中的指定字符串
5、运行测试程序查看结果
1、在你的项目中引入hutool的jar包
2、定义str 字符串和fromIndex 开始位置(包括)
3、searchStr 被查找的字符串rep盟敢势袂lacement 被替换的字符串ignoreCase 是否忽略大小写
4、String s = StrUtil.replace(str1,from诔罨租磊Index,searchStr,replacement,ignoreCase);//替换字符串中的指定字符串
5、运行测试程序查看结果