spierce7
08/08/2019, 5:25 PMobject Example {
fun String.exampleExtension() {
}
}
fun test(str: String) {
str.exampleExtension() // Doesn't work. How can I use the extension function?
}
Shawn
08/08/2019, 5:27 PMwith(Example) {
str.exampleExtension()
}
Example
to any function that takes T.() -> *
will work, like apply
spierce7
08/08/2019, 5:44 PM