Skip to content

Instantly share code, notes, and snippets.

@dirkgr
Last active August 29, 2015 14:04
Show Gist options
  • Save dirkgr/af46340cb746d9633239 to your computer and use it in GitHub Desktop.
Save dirkgr/af46340cb746d9633239 to your computer and use it in GitHub Desktop.
Enrichment for Scala strings that enables Python-like string formatting
class FormattableString(string: String) {
def %(args: Any*) = string.format(args:_*)
}
object FormattableString {
implicit def formattableString(string: String):FormattableString = new FormattableString(string)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment