url_strip_protocol

url

Removes the protocol from a URL

Syntax

url_strip_protocol(url)

Parameters

url (string)

The URL string to modify

Returns

string

The URL without the protocol

Examples

Input:
url_strip_protocol("https://example.com")
Output:
"example.com"
Input:
url_strip_protocol("https://example.com/path?query=value")
Output:
"example.com/path?query=value"

The url_strip_protocol() function removes the protocol (scheme) and ”://” separator from a URL, leaving the domain and all other components intact.

Usage

Use url_strip_protocol() when you need protocol-agnostic URLs, such as creating protocol-relative URLs for cross-protocol compatibility or simplifying URL display in user interfaces.