Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

filtering out unique values from a list in java

ArrayList<String> listWithDuplicateValues = new ArrayList<>();
list.add("first");
list.add("first");
list.add("second");

ArrayList uniqueList = (ArrayList) listWithDuplicateValues.stream().distinct().collect(Collectors.toList());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #filtering #unique #values #list #java
ADD COMMENT
Topic
Name
8+2 =