Created
February 17, 2026 01:14
-
-
Save skydoves/33071c5614ffe7b24cc8a7ac74a4d9db to your computer and use it in GitHub Desktop.
Kotlin Extension Function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun String.addExclamation(): String { | |
| return this + "!" | |
| } | |
| fun main() { | |
| val result = "skydoves".addExclamation() | |
| println(result) // Output: skydoves! | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment