Returns whether the string is empty (i.e. whether its length is 0).
This function does not modify the value of the string in any way. To clear the content of a string, see string::clear.
Parameters
none
Return Value
true if the string length is 0, false otherwise.
Example
|
|
This program reads the user input line by line and stores it into string content until an empty line is introduced.
Complexity
Iterator validity
No changes.
Data races
The object is accessed.
Exception safety
No-throw guarantee: this member function never throws exceptions.
See also
- string::clear
- Clear string (public member function )
- string::size
- Return length of string (public member function )
- string::length
- Return length of string (public member function )