It extends the string by appending additional characters at the end of its current value.
DeclarationFollowing is the declaration for std::string::operator+=
string& operator+= (const string& str);C++11
string& operator+= (const string& str);Parameters
str − It is a string object.
c − It is a character object.
It returns *this.
Exceptionsif an exception is thrown, there are no changes in the string.
ExampleIn below example for std::string::operator+=.
#include <iostream> #include <string> int main () { std::string name ("Sairamkrishna"); std::string family ("Mammahe"); name += " Prasad. "; name += family; name += '\n'; std::cout << name; return 0; }
Sairamkrishna Prasad. Mammahe
string.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4