62,614
社区成员
发帖
与我相关
我的任务
分享
public class Test {
public static void main(String args[]) {
String str = "61.54.231.246 61.54.231.246 河南省安阳市 未知地区";
String regex = "(?<=\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})\\s+";
str = str.replaceAll(regex, ",");
System.out.println(str);
}
}