public member function
<string>
std::basic_string::clear
Clear string
Parameters
noneReturn value
noneExample
|
|
This program repeats every line introduced by the user until a the line contains a dot ('.'). Every newline character ('\n') triggers the repetition of the line and the clearing of the current string content.
Complexity
Unspecified, but generally constant.Iterator validity
Any iterators, pointers and references related to this object may be invalidated.Data races
The object is modified.Exception safety
No-throw guarantee: this member function never throws exceptions.See also
- basic_string::erase
- Erase characters from string (public member function)
- basic_string::resize
- Resize string (public member function)
- basic_string::empty
- Test whether string is empty (public member function)