A thing to look out for when using the toString method in Kotlin is the handling of null in combination with the String?.
toString
String?
For example you want to get text from an EditText in Android.
EditText
You would have a piece of code like:
// Correct: val text = view.textField?.text?.toString() ?: ""
Read Articlehttps://develop.horje.com/learn/1434/reference