Created
September 26, 2019 09:42
-
-
Save sgabber/312cf31b5a9c4ef48d412e15bdd2700c to your computer and use it in GitHub Desktop.
testing prefix and postfix operators
or just messing with strings
This file contains 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
println("messing with strings") | |
implicit class Screamer(s:String) { | |
def ! = s.toUpperCase | |
def !(o:String) = s.toUpperCase + o.toLowerCase | |
def unary_! = s.toLowerCase | |
} | |
println("ciao"!) | |
println(!"CIAOO") | |
println("ciaoo"!"CIAOO") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment