Objectives :

  • File Name : string_insert_list_iteration1.cpp
    Inserting an array of strings  to a list.
  • Splicing like function of Insert:
    • Operation : temp.insert(0, str3,5, string::npos); will print "Space" from the string Cloud Space
    • Operation : temp.insert(0, str3,7, string::npos);  will print "pace" from the string Cloud Space.
  • Code: string_insert_list_iteration1.txt

Step: 1 Create a source file.

Step: 2 Edit and save Source file

Step: 3 Runtime Views:

Step: Brief Discussion:

b) Now if we increase, splicing length from 0-5 to 0-7, as shown in the illustration below, the output will be "pace", and this section "Cloud S" will be skipped.

As expected that the section "Cloud S" will be skipped and only the section "pace" would be displayed as an end product of insert operation.