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 ) 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
Get step-by-step solutions from verified subject matter experts
