customer2^sc1^admin1|server1~, customer3^sc1^admin1|server3, server2~, customer1^sc1^admin1|server1, server2, server3~
例如,我可以在,_
的每个实例后删除每个~
吗?我怎么能做到这一点?
答案 0 :(得分:3)
您可以使用java String replaceAll fonction:
yourString = "customer2^sc1^admin1|server1~, customer3^sc1^admin1|server3, server2~, customer1^sc1^admin1|server1, server2, server3~"
yourString = yourString.replaceAll("~, ", "~")