Write a statement that uses the Insert method to change the
Write a statement that uses the Insert method to change the string stored in the word variable from “in” to “spin”.
Solution
In cpp :
std :: string word=\"in\";
std :: string str1=word;
word.insert(0,\"sp\");
cout<<str1<<\" became \"<<word;
In java :
StringBuffer sb=new StringBuffer(\"in\");
System.out.println(sb+\" became \"+sb.insert(0,\"sp\"));
