:relfileprefix: ../../../
[#6C200BA8F2575083A994F64767FFF240E6CD0ADE]

= Function segments_encoded_base::front

pass:v,q[Return the first segment]


== Synopsis

Declared in header `</boost/url/segments_encoded_base.hpp#L244[boost/url/segments_encoded_base.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/pct_string_view.adoc[pct_string_view]
front() const noexcept;
----

== Description

pass:v,q[This function returns a string with the] pass:v,q[first segment of the path without any]
pass:v,q[leading or trailing '/' separators.]
pass:v,q[The returned string may contain]
pass:v,q[percent escapes.]

=== Preconditions
[,cpp]
----
this->empty() == false
----

=== Effects
[,cpp]
----
return *begin();
----

=== Example
[,cpp]
----
assert( url_view( "/path/to/file.txt" ).encoded_segments().front() == "path" );
----

=== Complexity
pass:v,q[Constant.]

=== Exception Safety
pass:v,q[Throws nothing.]



== Return Value

* `pct_string_view` 




