I Have String With Numbers When Getting The Char From String It Shows '0'48 In Kotlin. How To Get The Char Alone In Kotlin
Here we initialize a variable and get the first element but the expected result is not obtained var temBits = '00000000000000000001' temBits.elementAt(0)` Result = '0' 48 expected
Solution 1:
The result is displayed as 48 as 48 is the ascii value of 0. Converting to integer would help.
Try:
temBits.elementAt(0).toString().toInt()
Post a Comment for "I Have String With Numbers When Getting The Char From String It Shows '0'48 In Kotlin. How To Get The Char Alone In Kotlin"