I converted some Java over to Kotlin and: ` List&l...
# announcements
p
I converted some Java over to Kotlin and:
List<String> parts = Lists.newArrayList(title.split("/"));
became:
val parts = Lists.newArrayList(*title.split("/".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray())
I get the
dropLastWhile { it.isEmpty() }.toTypedArray()
is to remove any null String from the final List but is there a shorter way to write that?