Hey Can we eliminate characters from string *For e...
# android
v
Hey Can we eliminate characters from string *For exampl*e
val string = "000010"
or
val string = "010"
to get only
10
e
Copy code
string.trimStart('0')
❤️ 3
2
v
Oh, nice, was about to say
Copy code
string.replaceFirst("^0++".toRegex(), "")
but
trimStart
is better of course
v
Thanks @ephemient for great answer
thanks @Vampire