split


Description:

[ Version ( since = "2.66" ) ]
public static bool split (string uri_string, UriFlags flags, out string? scheme, out string? userinfo, out string? host, out int port, out string? path, out string? query, out string? fragment) throws UriError

Parses uri_ref (which can be an [absolute or relative URI](relative-and-absolute-uris)) according to flags , and returns the pieces.

Any component that doesn't appear in uri_ref will be returned as null (but note that all URIs always have a path component, though it may be the empty string).

If flags contains g_uri_flags_encoded, then `%`-encoded characters in uri_ref will remain encoded in the output strings. (If not, then all such characters will be decoded.) Note that decoding will only work if the URI components are ASCII or UTF-8, so you will need to use g_uri_flags_encoded if they are not.

Note that the g_uri_flags_has_password and g_uri_flags_has_auth_params flags are ignored by split, since it always returns only the full userinfo; use split_with_user if you want it split up.

Parameters:

flags

flags for parsing uri_ref

scheme

on return, contains the scheme (converted to lowercase), or null

userinfo

on return, contains the userinfo, or null

host

on return, contains the host, or null

port

on return, contains the port, or `-1`

path

on return, contains the path

query

on return, contains the query, or null

fragment

on return, contains the fragment, or null

uri_ref

a string containing a relative or absolute URI

Returns:

true if uri_ref parsed successfully, false on error.