Skip to content

Instantly share code, notes, and snippets.

@sajjadyousefnia
Created June 2, 2018 11:29
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 sajjadyousefnia/0db3e8fa266d7d5b45649fb22d361411 to your computer and use it in GitHub Desktop.
Save sajjadyousefnia/0db3e8fa266d7d5b45649fb22d361411 to your computer and use it in GitHub Desktop.
val stringList: List<String> = listOf("in", "the", "club")
print(stringList.last()) // will print "club"
print(stringList.last({ s: String -> s.length == 3})) // will print "the"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment