xtd 0.2.0
Loading...
Searching...
No Matches

◆ get_left_part()

xtd::ustring xtd::uri::get_left_part ( xtd::uri_partial  part) const

Gets the specified portion of a xtd::uri instance.

Parameters
part= One of the xtd::uri_partial values that specifies the end of the URI portion to return.
Returns
string A string that contains the specified portion of the xtd::uri instance.
Exceptions
xtd::invalid_operation_exceptionThis instance represents a relative URI, and this property is valid only for absolute URIs.
ArgumentExceptionThe specified part is not valid.
Remarks
The get_left_part method returns a string containing the leftmost portion of the URI string, ending with the portion specified by part.
get_left_part includes delimiters in the following cases:
* scheme includes the scheme delimiter.
* authority does not include the path delimiter.
* Path includes any delimiters in the original URI up to the query or fragment delimiter.
* query includes the Path, plus the query and its delimiter.
The following examples show a URI and the results of calling get_left_part with scheme, authority, Path, or query.
URI Scheme Autority Path Query
http://www.contoso.com/index.htm?date=today http:// http://www.contoso.com http://www.contoso.com/index.htm http://www.contoso.com/index.htm?date=today
http://www.contoso.com/index.htm#main http:// http://www.contoso.com http://www.contoso.com/index.htm http://www.contoso.com/index.htm
user@.nosp@m.cont.nosp@m.oso.c.nosp@m.om?subject=uri mailto: user@.nosp@m.cont.nosp@m.oso.c.nosp@m.om user@.nosp@m.cont.nosp@m.oso.c.nosp@m.om?subject=uri <None>
nntp://news.contoso.com/123456@contoso.com nntp:// nntp://news.contoso.com nntp://news.contoso.com/123456@contoso.com nntp://news.contoso.com/123456@contoso.com
news:123456@contoso.com news: news:123456@contoso.com news:123456@contoso.com <None>
file://server/filename.ext file:// file://server file://server/filename.ext file://server/filename.ext