C++ String append()
This function is used to extend the string by appending at the end of the current value.
Consider string str1 and str2. Syntax would be :
str : 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.
This function does not return any value.
Let's see the example of appending the string in another string object.
Before appending,string value is Welcome to C++ programming After appending,string value is Welcome to C++ programming language
Let's see the example of appending the string by using position and length as parameters.
Before appending, string value is Mango is my favourite After appending, string value is Mango is my favourite fruit
Let's see another example.
String value is Kashmir is nature of beauty
Next TopicC++ Strings
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week