[#bsl-basic_string-0f3-length] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0f3.adoc[basic_string<char32_t>]::length :relfileprefix: ../../ :mrdocs: Return the length of this string. Note that this number may differ from `CHAR_TRAITS::length(c_str())` in case the string contains null characters. Also note that a null‐terminating character added by the `c_str` method is _not_ counted in this length. == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0f3/size_type.adoc[size_type] length() const noexcept; ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#