Last active
February 11, 2017 21:37
-
-
Save vvviiimmm/ee35df718a8fff93b0aefe7763648ed1 to your computer and use it in GitHub Desktop.
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
object Helpers { | |
implicit class StringOps(str: String) { | |
def yell = str.toUpperCase() + "!" | |
def isQuestion = str.endsWith("?") | |
} | |
} | |
"Hello world".yell // evaluates to "HELLO WORLD!" | |
"How are you?".isQuestion // evaluates to 'true' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment