Is there a find or throw method on lists?
# getting-started
k
Is there a find or throw method on lists?
s
.first { }
will throw if it doesn’t find a match
o
Just keep in mind that exceptions might not be the right tool for the job: https://elizarov.medium.com/kotlin-and-exceptions-8062f589d07