Step: Brief Discussion:
Operation " temp = str1.insert(0,str2); " : The red lines shows
the insertion of string "str2" . before ("0" position) of another
string, namely "str1). The expected output was "Good World Hello
World" . The string "temp" is a temporary space holder.
Operation
temp.insert(0, str3,5, string::npos); :Here temp string
has been emptied, and the insert function will bypass a section of
string "str3" , starting from 0 to 5, copy the rest of the string
(i.e. "Space" and add to temp string.
Operation
" list <string> Lstr1(strarray, strarray+3); " : The list
object, "Lstr1" will receive the contents of a string-array "strarray",
which would have three strings, "Hello World Good World Cloud Space"
respectively. .
Operation
" Lstr1.insert(it,1,"Green Revolution"); " : In this case insert
function will append "1" item after a series of strings saved with
iteration, "it". Now, the Lstr1 will have four elements in a series
, namely ""Hello World Good World Cloud Space Green Revolution".