Reputation: 15
In java, this code worked:
String tempDir = c.getString(0);
tempDir = tempDir.substring(0, tempDir.lastIndexOf("/"));
But I can't write this code in kotlin:
var string: String = c.getString(0)
var sequence: CharSequence = tempDir.subSequence(0, string.length)
var indexLast = sequence.lastIndexOf("/",0,false) // error
Upvotes: 0
Views: 320