Please use Java/** * Returns a new string version of the current string where the capitalization is reversed (i.e., lowercase to uppercase, and uppercase to lowercase) for the alphabetical characters specified in the given arg. * * All non-alphabetical characters are unaffected. * If the current string is null, empty, or has not been set to a value, this method should return an empty string. * * Example(s): * - For a current string "abc, XYZ; 123.", calling reverse("bcdxyz@3210.") would return "aBC, xyz; 123." * - For a current string "abc, XYZ; 123.", calling reverse("6,.") would return "abc, XYZ; 123." * - For a current string "abc, XYZ; 123.", calling reverse("") would return "abc, XYZ; 123." * - For a current string "", calling reverse("") would return "" * * Remember: This method builds and returns a new string, and does not directly modify the myString field. * * @param arg the string containing the alphabetical characters to have their capitalization reversed in the current string * @return new string in which the alphabetical characters specified in the arg are reversed */ public String reverse(String arg) {
Please use Java/**
* Returns a new string version of the current string where the capitalization is reversed (i.e., lowercase to uppercase, and uppercase to lowercase) for the alphabetical characters specified in the given arg.
*
* All non-alphabetical characters are unaffected.
* If the current string is null, empty, or has not been set to a value, this method should return an empty string.
*
* Example(s):
* - For a current string "abc, XYZ; 123.", calling reverse("bcdxyz@3210.") would return "aBC, xyz; 123."
* - For a current string "abc, XYZ; 123.", calling reverse("6,.") would return "abc, XYZ; 123."
* - For a current string "abc, XYZ; 123.", calling reverse("") would return "abc, XYZ; 123."
* - For a current string "", calling reverse("") would return ""
*
* Remember: This method builds and returns a new string, and does not directly modify the myString field.
*
* @param arg the string containing the alphabetical characters to have their capitalization reversed in the current string
* @return new string in which the alphabetical characters specified in the arg are reversed
*/
public String reverse(String arg) {
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images