format Path
Replaces each {}
placeholder in the template string with the URL-encoded form of the corresponding list element.
For example:
formatPath("/foo/{}/bar/{}", listOf("hello world", "a/b"))
Content copied to clipboard
returns the string "/foo/hello%20world/bar/a%2Fb"
Throws
if the number of placeholders does not match the size of the list.
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")
Content copied to clipboard
returns the string "/foo/hello%20world/bar/a%2Fb"
Throws
if the number of placeholders does not match the number of additional arguments.