String mobiles="1234567890,0987654321,1234567890,1122334455"
我需要输出
mobiles = "1234567890,0987654321,1122334455";
int count = 3;
我在java编码。
答案 0 :(得分:0)
@YSF_L的回答是正确的
String mobiles = Arrays.stream(mmobiles.split(",")) .distinct() .collect(Collectors.joining(","));
String[] mcounts = mobiles.split(",");
int Count = mcounts.length;