[#bsl-basic_string-01d-operator_subs-01] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-01d.adoc[basic_string<char8_t>]::operator[] :relfileprefix: ../../ :mrdocs: Subscript operators == Synopses Declared in `<bslstl_string.h>` Return a reference providing modifiable access to the character at the specified `position` in this string if `position < length()`, or a reference providing non‐modifiable access to the null‐terminating character if `position == length()`. The behavior is undefined unless `position <= length()`, and, in the case of `position == length()`, the null‐terminating character is not modified through the returned reference. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-01d/reference.adoc[reference] xref:bsl/basic_string-01d/operator_subs-09.adoc[operator[]](xref:bsl/basic_string-01d/size_type.adoc[size_type] position); ---- [.small]#xref:bsl/basic_string-01d/operator_subs-09.adoc[_» more..._]# Return a reference providing non‐modifiable access to the character at the specified `position` in this string. The behavior is undefined unless `position <= length()`. Note that if `position == length()`, a reference to the null‐terminating character is returned. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-01d/const_reference.adoc[const_reference] xref:bsl/basic_string-01d/operator_subs-0a.adoc[operator[]](xref:bsl/basic_string-01d/size_type.adoc[size_type] position) const; ---- [.small]#xref:bsl/basic_string-01d/operator_subs-0a.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#