Kotlin provides several functional APIs for manipulating collections. These help you to simplify your code and handle common tasks without needless boilerplate. In this video, learn about different ways you can filter your data.
- [Instructor] Kotlin provides several functional APIs…for manipulating collections.…These help you to simplify your code…and handle common tasks without needless boilerplate.…For example, there are many functions…which aid in filtering your data.…Let's say we have a list of users, aged 35, 25, and 14.…And we only want those who are old enough to drive.…One approach could be to create a new list,…then iterate over the existing list,…check for the age we want,…and then add the user to our new list.…
But this is just boilerplate code…that somewhat obscures what we're trying to achieve.…So instead of that, we can use the filter function…and provide the lambda which we want to check against.…Notice that we're using our familiar it variable.…This is going to represent a given instance of a user…and then we compare their age to the number 16.…This is going to return to us…our desired list of users, Nate and Andrea.…At the same time,…it leaves our original list of users intact.…
In fact, Kotlin has many functions that you can use…
- What Kotlin has to offer
- Working with lambdas
- Common Android extension functions
- Kotlin Android Extensions overview
- Making use of the Anko library
- Working with coroutines
- Nullability and collections
Skill Level Intermediate
Android App Development: Data Persistence Librarieswith Annyce Davis3h 59m Intermediate
Developing AWS Lambda Functions with Kotlinwith Troy Miles1h 55m Intermediate
1. Kotlin Overview
2. Extension Functions and Properties
3. Incorporating Anko
4. Advanced Anko
5. Working with Collections
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.