Course Solutions Uncategorized (Solved) : 4 Write Program Method Called Middleinsert Inserts String Str1 Middle Another String Str2 Q26621069 . . . .

(Solved) : 4 Write Program Method Called Middleinsert Inserts String Str1 Middle Another String Str2 Q26621069 . . . .

 

Code Java
4) Write a program with a method called middleInsert) that inserts a string (str1) into the middle of another string (str2) at a defined position (pos). The method will return a new String. You will need to handle these situations: if pos 0, insert str2 at beginning of str1. If pos> length of str1, insert str2 at the end of str1 (these are the easy cases). If either String is null throw a new I1legalArgumentException (20pts) Use these test cases: System .out.printIn(middleInsert (A Man a plan Panama, #4#4, 0)); System.out.println(middleInsert(A Man a plan Panama, 200)) System . out.printIn(middleInsert (A Man a plan Panama , #### , 5)); To produce this output: ####A Man a plan Panama A Man a plan Panama#### A Man#### a plan Panama acer4)

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post