[#bsl-basic_string-01d-length]
= xref:bsl.adoc[bsl]::xref:bsl/basic_string-01d.adoc[basic&lowbar;string&lt;char8&lowbar;t&gt;]::length
:relfileprefix: ../../
:mrdocs:

Return the length of this string&period; Note that this number may differ from `CHAR&lowbar;TRAITS&colon;&colon;length(c&lowbar;str())` in case the string contains null characters&period; Also note that a null&hyphen;terminating character added by the `c&lowbar;str` method is _not_ counted in this length&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;string&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-01d/size_type.adoc[size&lowbar;type]
length() const noexcept;
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
