url.pathEscape
This function returns the escaped string so it can be safely placed inside a URL path segment, replacing special characters (including /
) with %XX
sequences as needed.
Syntax
url.pathEscape(pathString)
Arguments
Argument |
Type |
Description |
---|---|---|
pathString |
string |
The path string |
Returns
Type |
Description |
---|---|
string |
The escaped PATH string |
Examples
The function url.pathEscape("/some-path with ([brackets])")
returns "%2Fsome-path%20with%20%28%5Bbrackets%5D%29
".