Created
October 4, 2011 18:02
-
-
Save jaytaylor/1262333 to your computer and use it in GitHub Desktop.
Pythonic Scala 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
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