Skip to content

urlEncodeComponent

urlEncodeComponent(string) → string · URL

URL-encode a component string (RFC 3986) — encodes spaces as %20 for URI paths.

  • string (required): the string to encode
utlx
urlEncodeComponent("hello world/path")   // "hello%20world%2Fpath"

Released under AGPL-3.0.