Convert String to Long in Kotlin with example
February 28, 2022 · 1 min read
This tutorial explains about multiple ways to convert String to Long and Long to String There are multiple ways we can convert String to Long type in kotlin. Convert String to Long value use valueOf method import java.lang.Long; fun main() { val value = Long.valueOf("11"); println(value); //11 println(value is kotlin.Long);// true } use toLong method toLong or toLongOrNull method takes string object and returns an long value. toLongOrNull method returns null or long value....