Hello, World! Hey I'm very often finding myself n...
# stdlib
b
Hello, World! Hey I'm very often finding myself needing a
indexOf
but with a default value (instead of -1). Is this something that exists? If not, I'm gonna make my own extension - what would you name it? 🙂
s
indexOfOrDefault()
. In my projects I have made
indexOfOrNull()
that sort of handles the same case
b
yeah
indexOfOrNull
could be good too 🤔