[Solved] I want unique mobile numbers and count from comma delim String variable [closed]


Answer by @YSF_L is correct
String mobiles = Arrays.stream(mmobiles.split(",")) .distinct() .collect(Collectors.joining(","));
String[] mcounts = mobiles.split(",");
int Count = mcounts.length;

solved I want unique mobile numbers and count from comma delim String variable [closed]