Skip to content

Instantly share code, notes, and snippets.

@OwloneDev
Created August 18, 2020 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OwloneDev/fba5f15aa0ae81188a6c74ab4e1447c1 to your computer and use it in GitHub Desktop.
Save OwloneDev/fba5f15aa0ae81188a6c74ab4e1447c1 to your computer and use it in GitHub Desktop.
Add ArrayList to HashSet
fun HashSet<String>.add(list: ArrayList<*>) {
for (i in list) this.add(i)
}
val set = HashSet<String>()
val list = ArrayList<*>()
set.add(list)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment