首页 > 其他 > 详细

String replace多个符号或字符

时间:2018-03-27 10:43:15      阅读:363      评论:0      收藏:0      [点我收藏+]

代码块

1     public static void main(String[] args) {
2         test t = new test();
3         String a = "a+-b+ -c+ -d -e";
4         System.out.println(a);
5         System.out.println(a.replaceAll("(-|\\+| )",","));
6     }

运行结果

a+-b+ -c+ -d -e 
a,,b,,,c,,,d,,e

String replace多个符号或字符

原文:https://www.cnblogs.com/anitinaj/p/8656132.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!