tencent cloud

URLSearchParams.toString
Last updated: 2025-03-11 20:21:25
URLSearchParams.toString
Last updated: 2025-03-11 20:21:25
URLSearchParams.toString is used to get the string of search parameters that can be directly used in a URL.
toString(): string

Return

Type
Description
string
The string of search parameters.

Samples

Get the string of search parameters:
import url from 'pts/url';

export default function() {
const params = new url.URLSearchParams('key1=value1&key2=value2');

params.set('key3', 'value3');
console.log(params.toString()); // key1=value1&key2=value2&key3=value3
}

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback