我有一个从 API 检索到的电话号码列表,它是这样的:(22) 9969-6666 我需要更改它,所以它看起来像这样:+552299696666
到目前为止我尝试的是:
String phoneNum = "(22) 9969-6666 ";
System.out.println(phoneNum.replaceFirst("(\\d{3})(\\d{3})(\\d+)", "($1)-$2-$3"));
给我以下结果:
10-08 00:23:04.155 30677-30677/br.com I/System.out﹕ (22) (996)-966-66