formatPath

fun formatPath(template: String, vararg args: String): String

Replaces each {} placeholder in the template string with the URL-encoded form of the corresponding additional argument.

For example:

    formatPath("/foo/{}/bar/{}", "hello world", "a/b")

returns the string "/foo/hello%20world/bar/a%2Fb"

Throws

if the number of placeholders does not match the number of additional arguments.