Skip to content

Instantly share code, notes, and snippets.

@jaytaylor
Created October 4, 2011 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaytaylor/1262333 to your computer and use it in GitHub Desktop.
Save jaytaylor/1262333 to your computer and use it in GitHub Desktop.
Pythonic Scala Strings
class StringExtras(string: String) { def % (args: Any*) = String.format(string, args.toArray.asInstanceOf[Array[Object]]: _*) }
implicit def stringExtras(string: String) = new StringExtras(string)
"%s, %s" % ("hello", "world")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment