url.encode

This function returns the URL encoded form of the input string.

Syntax

url.encode(rawURLString)

Arguments

Argument

Type

Description

rawURLString

string

Raw URL string

Returns

Type

Description

string

The URL encoded string

Examples

The function url.encode("https://subdomain.example.com/path?q=hello world#fragment with space") returns https://subdomain.example.com/path?q=hello+world#fragment%20with%20space.