Scala offers a method called stripMargin that removes the left-hand part of a multiline string up to a specified delimiter (default: "|"). Here is an example:
"""|Foo
|Bar""".stripMargin
returns the string
Foo
Bar
Is there a similar function in Clojure? If not, how would you implement it (most functionally)?
Thanks.
UPDATE: The example I gave is not complete. The stripMargin method also preserves whitespace after the delimiter:
"""|Foo
| Bar""".stripMargin
returns the string
Foo
Bar