Mega Code Archive

 
Categories / C++ Tutorial / String
 

Append subscript locations 4 through the end of one string to create another string

#include <iostream> #include <string> using namespace std; int main() {    string s1( "cat" ), s5;    s5 = "this is a test";    s5.append( s1, 4, s1.size() );        return 0; }