Question: Now, the above call to insert, i.e., insert( chArray, s, k ) will look for 'e' in the string s. There is an 'e' at

 Now, the above call to insert, i.e., insert( chArray, s, k

Now, the above call to insert, i.e., insert( chArray, s, k ) will look for 'e' in the string s. There is an 'e' at the index location 1 in s. Therefore, the function insert will return a string containing "eelpo" by inserting the value of variable c at the location just before where there is a match of ' e ' found in the string s. If no such match is found then the value of c will be appended in s at the end. String s="Helpo"; char c = 'z'; char [] chArray =new char[s.length() +2]; println(insert( chArray, s, c)); will print Helpoz

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!