<Is there a way to make the first digit of int alw...
# stackoverflow
u
Is there a way to make the first digit of int always start with 1 in Kotlin Let's say I have the following class constructor: class Car(val brand: Brand,val modelName: String, val version: Int){} If for example, I want the version number to always start with 1. Is there a way to manipulate it in the class body to achieve this ? Meaning: val firstdigit:Int = abs(version).ToString().Substring(0,1) And then parse it to Int. But how to replace the original first digit after that? I'm just learning Kotlin and I got a bit stuck with this