rbegin refers to the character right before the one that would be referred to by member end.
Parameters
noneReturn Value
A reverse iterator to the reverse beginning of the string (i.e., the last character).The type of this iterator is either string::reverse_iterator member type or string::const_reverse_iterator member type, which are compiler specific iterator types suitable to perform a reverse iteration through the elements of a string object.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
This code prints out the reversed content of a string character by character using a reverse iterator that iterates between rbegin and rend. Notice how even though the reverse iterator is increased, the iteration goes backwards through the string (this is a feature of reverse iterators).
The actual output is:
...evil pets won |
Basic template member declaration
( basic_string<charT,traits,Allocator> )| 1 2 |
|
See also
| string::rend | Return reverse iterator to reverse end (public member function) |
| string::begin | Return iterator to beginning (public member function) |
| string::end | Return iterator to end (public member function) |
