Skip to content

Instantly share code, notes, and snippets.

@vvviiimmm
Last active February 11, 2017 21:37
Show Gist options
  • Save vvviiimmm/ee35df718a8fff93b0aefe7763648ed1 to your computer and use it in GitHub Desktop.
Save vvviiimmm/ee35df718a8fff93b0aefe7763648ed1 to your computer and use it in GitHub Desktop.
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