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.
reference
operator[](size_type position);
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.
const_reference
operator[](size_type position) const;
Created with MrDocs