parse

fun parse(text: String): Result<Url>(source)

Parses text by the rules in the class description; parse(url.toString()) yields an equal Url.

Return

the canonical URL, or a failure holding an IllegalArgumentException with one constant message per kind of problem; the message never echoes text.

Parameters

text

the URL text, as typed; TAB, LF, FF, CR and SP are trimmed at the ends.