https://kotlinlang.org logo
j

joelpedraza

10/09/2017, 3:13 PM
@myanmarking how about
str.indexOf(searchTerm).let { it to it + searchTerm.length }
(the start index will be negative if seachTerm is not in str)