- java Sting 如何替换指定位置的字符
public static void main(String[] args) {
String str = "****";
if(StringUtils.isNotBlank(str)){
StringBuilder sb = new StringBuilder("18698587234");
sb.replace(3, 7, str);
System.err.println("========"+sb.toString());
}
}12345678
结果如下:
🐞标题:java Sting 如何替换指定位置的字符
👽作者:ruige
🐾地址:https://jjdhhc.com/articles/2020/11/07/1604720223755.html
🙏感恩:谢谢您的打赏与支持!中间图片是我的微信公众号,扫码关注哦!


