Skip to content

Instantly share code, notes, and snippets.

View ivyl's full-sized avatar
🙃

Arek Hiler ivyl

🙃
View GitHub Profile
implicit def repl4str(s: String) = new Object {
def %(pairs: (String, String)*) = (s /: pairs){ case (s, (k, v)) => s.replace("%{" + k + "}", v) }
}
"foo %{bar} and %{baz}" % ("bar" -> "xxx", "baz" -> "blah") // "foo xxx and blah"