🔥 Huge shoutout to @SVDG_XEC the absolute legend who just swept through my #NFT collection like a storm! 🙌
— Gaexe (@gaexe_) May 30, 2025
Your support isn’t just noticed — it’s legendary. You didn’t just collect — you made history. 🚀
Looks like I’ll be pulling an all-nighter tonight.👨💻🌙 #NFTCollector $XEC pic.twitter.com/vKwKByk7fi
How to idiomatically remove duplicates from Array<String?> in kotlin?
There are several ways to solve this problem, including;
1). Using distinct extension function :
val a = arrayOf("a", "a", "b", "c", "c")
val b = a.distinct() // ["a", "b", "c"]There is also a distinctBy function that allows one to specify how to distinguish items:
val a = listOf("a", "b", "ab", "ba", "abc")
val b = a.distinctBy { it.length } // ["a", "ab", "abc"]You can also use toSet , toMutableSet and if you don't need to preserve the original order, toHashSet . These functions produce a Set , not a List , and should be slightly more efficient than Distinct .
