encodeURLPath

fun String.encodeURLPath(encodeSlash: Boolean = false, encodeEncoded: Boolean = true): String

Get the URL-encoding of this string, with options to skip / characters or to prevent encoding already-encoded characters (%hh items).

Parameters

encodeSlash

/ characters will be encoded as %2F; defaults to false

encodeEncoded

%hh will be encoded as %25hh; defaults to true

See also