frellan
09/04/2018, 11:42 AM-1
crap that indexOf
throws if it does not find something in a string. I find this ugly and unidiomatic for kotlin
var doubleslash = url.indexOf("//")
if (doubleslash == -1) doubleslash = 0 else doubleslash += 2
Would like it to be similar to (I know this dont work):
val doubleslash = (url.indexOf("//") + 2) ?: 0