[/code]怎么把30 31 32*40 *32用正则变成30 31 32 40 32复制代码
- [code=Java]
- public class Test {
- public static void main(String[] args) {
- String s = "30 31 32*40 *32";
- StringBuilder sb = new StringBuilder(s);
- sb.replace(5, 8, " ").replace(8, 9, " ").replace(11, 15, " ");
- System.out.println(sb.toString());
- }
- }
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |