本帖最后由 李计伟 于 2012-11-3 01:02 编辑
- [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());
- }
- }
复制代码 [/code]怎么把30 31 32*40 *32用正则变成30 31 32 40 32
|