Because the diversity of left-hand parameter types, this function is implemented as an overload of the global operator+ function.
Parameters
- lhs
- A string object, a c-string or a character. Its content forms the beginning of the returned object.
- rhs
- If lhs is a string object, this is another string object, a c-string or a character.
If lhs is not a string object, this is a string object.
In either case, the content of rhs follows that of lhs in the returned object.
Notice that at least one of the arguments used has to be a string object.
Return value
A string object with the content of both lhs and rhs.Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Output:
http://www.cplusplus.com |
Basic template declaration
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
See also
| string::append | Append to string (public member function) |
| string::assign | Assign content to string (public member function) |
