Skip to content

urlJoin

Merges the given string argument with the first argument (the beginning of the URL), joining it so that the slash (/) symbol is correctly included.

In Dart, accepts only one argument, organized as an List.

Parameters

NameTypeRequiredDefault
args...any[]
URL segments to join (rest parameter). In Dart, pass a single List<dynamic>.

Returns

string

Examples

javascript
urlJoin('https://example.com', 'hello', 'world'); // Returns 'https://example.com/hello/world'
dart
urlJoin(['https://example.com', 'hello', 'world']); // Returns 'https://example.com/hello/world'
python
urlJoin('https://example.com', 'hello', 'world')  # Returns 'https://example.com/hello/world'

Released under the MIT License