Skip to content

Extension Property

Rajesh Khadka edited this page Dec 4, 2018 · 3 revisions

Like the extension function, we can add extension property.

 val EditText.trimmedValue: String get() = text.toString().trim()

 Uses:
 findViewById<EditText>(R.id.edit_text).trimmedValue

Clone this wiki locally