The new string content is the content existing in the string object before the call followed by the content of the argument.
The append member function provides a similar functionality with additional options.
Parameters
- str
- string object. A copy of the content of this object is appended to the object's content.
- s
- A pointer to an array containing a null-terminated character sequence (C string), which is appended to the object's content.
- c
- Character. This single character is appended to the string object's content.
Return Value
*thisExample
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Output:
John K. Smith |
Basic template member declarations
( basic_string<charT,traits,Allocator> )| 1 2 3 4 5 |
|
See also
| string::append | Append to string (public member function) |
| string::assign | Assign content to string (public member function) |
| string::operator= | String assignment (public member function) |
| string::insert | Insert into string (public member function) |
| string::replace | Replace part of string (public member function) |
