Question: Which of the following methods will accept a string and a valid position in the string as parameters and return the string with the character

 Which of the following methods will accept a string and a

valid position in the string as parameters and return the string with

the character at that position removed? Examples: 11 'gratness"; stringDelete("greatness", 2) will

Which of the following methods will accept a string and a valid position in the string as parameters and return the string with the character at that position removed? Examples: 11 'gratness"; stringDelete("greatness", 2) will return stringDelete ("xy",0) will return "y"; stringDelete("", 0) will return ""; 1. public static String stringDeleteI(String str, int pos) { if (str.length()>0) return str.substring(0, pos) + str.substring(pos+1); return str; } II. public static String stringDeleteII(String str, int pos) { String out = "", letter = ""; if (str.length()>0) letter = str.substring(pos, pos+1); for (int i=0; i

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!