C++ String append()This function is used to extend the string by appending at the end of the current value. SyntaxConsider string str1 and str2. Syntax would be : Parametersstr : String object which is to be appended in another string object. pos : It determines the position of the first character that is to be appended to another object. len : Number of characters to be copied in another string object as substring. n : Number of characters to copy. Return valueThis function does not return any value. Example 1Let's see the example of appending the string in another string object. Output: Before appending,string value is Welcome to C++ programming After appending,string value is Welcome to C++ programming language Example 2Let's see the example of appending the string by using position and length as parameters. Output: Before appending, string value is Mango is my favourite After appending, string value is Mango is my favourite fruit Example 3Let's see another example. Output: String value is Kashmir is nature of beauty Next TopicC++ Strings |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India