Join Slack
Powered by
``` val index = input.indexOf(keyword).takeIf { it...
# random
c
cedric
01/24/2017, 9:51 PM
Copy code
val index = input.indexOf(keyword).takeIf { it >= 0 } ?: error("keyword not found")
This is yummy. I can’t count the number of times where
indexOf
code has bothered me.
7
Views
Open in Slack
Previous
Next