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\"));

Write a statement that uses the Insert method to change the string stored in the word variable from “in” to “spin”.SolutionIn cpp : std :: string word=\

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site