I have a string that is a version number but I only need the last two digits of the string. I.e, 15.0.4571.1502 -> 4571.1502. I can't seem to figure out an efficient way to do this in Kotlin.
Code:
version = "15.0.4571.1502"
var buildOne = version.split(".").toTypedArray()[2]
var buildTwo = version.split(".").toTypedArray()[3]
var new = "$BuildOne"."$BuildTwo"
Error:
The expression cannot be a selector (occur after a dot)
var new = "$buildOne.$buildTwo"instead.02.