Answers for "remove duplicate element from arraylist in android koltin"

0

remove duplicates from arraylist in android

ArrayList<Object> withDuplicateValues;
 HashSet<Object> withUniqueValue = new HashSet<>(withDuplicateValues);
 
 withDuplicateValues.clear();
 withDuplicateValues.addAll(withUniqueValue);
Posted by: Guest on May-17-2021
0

remove duplicates from a list in kotlin

val a = arrayOf("a", "a", "b", "c", "c")
val b = a.distinct() // ["a", "b", "c"]
Posted by: Guest on August-17-2021

Code answers related to "remove duplicate element from arraylist in android koltin"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language