KotlinSyntax
Extension Function
Code example
fun String.shout() = uppercase() + "!"Adds a function to an existing type.
In Kotlin, extension function: adds a function to an existing type — fun String.shout() = uppercase() + "!"
fun String.shout() = uppercase() + "!"fun String.shout() = uppercase() + "!"Adds a function to an existing type.
Use fun String.shout() = uppercase() + "!".
Use this pattern: fun String.shout() = uppercase() + "!"
Yes. Use Copy code and adapt the example to your program.
No. The language syntax is the same across operating systems.