Skip to content

Instantly share code, notes, and snippets.

@sgabber
Created September 26, 2019 09:42
Show Gist options
  • Save sgabber/312cf31b5a9c4ef48d412e15bdd2700c to your computer and use it in GitHub Desktop.
Save sgabber/312cf31b5a9c4ef48d412e15bdd2700c to your computer and use it in GitHub Desktop.
testing prefix and postfix operators or just messing with strings
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