当前位置: 代码迷 >> J2SE >> 怎么在字符串中插入字符
  详细解决方案

怎么在字符串中插入字符

热度:75   发布时间:2016-04-24 12:20:00.0
如何在字符串中插入字符
比如有字符串
String s = "aa,1,2,3"; 我想在每个,后插入一个字符X 就是处理后成
aa,x1,x2,x3

如何处理?
谢谢

------解决方案--------------------
Java code
        String s = "aa,1,2,3";        String out=s.replace(",",",x");        System.out.println("result:"+out);
  相关解决方案